class FrpEventsourcing::Map

Public Class Methods

new(source, blk) click to toggle source
# File lib/frp-eventsourcing/stream/map.rb, line 3
def initialize(source, blk)
  @resource_type = source.resource_type
  @unique_resource_identifier = source.unique_resource_identifier
  @block = blk
  source.add_observer(self)
end

Public Instance Methods

update(event) click to toggle source
# File lib/frp-eventsourcing/stream/map.rb, line 10
def update(event)
  @block.call(event)
  occur(event)
end