Module: Synapse::EventSourcing::Member::ClassMethods

Defined in:
lib/synapse/event_sourcing/member.rb

Instance Method Summary collapse

Instance Method Details

#child_entitiesSet

Returns a set of symbols referring to child entities

Returns:

  • (Set)


31
32
33
# File 'lib/synapse/event_sourcing/member.rb', line 31

def child_entities
  @child_entities ||= Set.new
end

#child_entity(*fields) ⇒ undefined

Registers an instance variable as a child entity

Parameters:

  • fields (Symbol...)

Returns:

  • (undefined)


23
24
25
26
27
# File 'lib/synapse/event_sourcing/member.rb', line 23

def child_entity(*fields)
  fields.each do |field|
    child_entities.add field.to_s
  end
end

#map_event(type, *args, &block) ⇒ undefined

Parameters:

  • type (Class)
  • args (Object...)
  • block (Proc)

Returns:

  • (undefined)

See Also:

  • Mapper#map


40
41
42
# File 'lib/synapse/event_sourcing/member.rb', line 40

def map_event(type, *args, &block)
  event_mapper.map type, *args, &block
end