module Synapse::EventSourcing::Member::ClassMethods

Public Instance Methods

child_entities() click to toggle source

Returns a set of symbols referring to child entities @return [Set]

# File lib/synapse/event_sourcing/member.rb, line 31
def child_entities
  @child_entities ||= Set.new
end
child_entity(*fields) click to toggle source

Registers an instance variable as a child entity

@param [Symbol…] fields @return [undefined]

# 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) click to toggle source

@see Mapper#map @param [Class] type @param [Object…] args @param [Proc] block @return [undefined]

# File lib/synapse/event_sourcing/member.rb, line 40
def map_event(type, *args, &block)
  event_mapper.map type, *args, &block
end