Class: Sequent::Generator::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/sequent/generator/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, event, attrs) ⇒ Event

Returns a new instance of Event.



12
13
14
15
16
# File 'lib/sequent/generator/event.rb', line 12

def initialize(name, event, attrs)
  @name = name
  @event = event
  @attrs = attrs.map{|a| a.split(':')}
end

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.



10
11
12
# File 'lib/sequent/generator/event.rb', line 10

def attrs
  @attrs
end

#eventObject (readonly)

Returns the value of attribute event.



10
11
12
# File 'lib/sequent/generator/event.rb', line 10

def event
  @event
end

Instance Method Details

#executeObject



18
19
20
21
# File 'lib/sequent/generator/event.rb', line 18

def execute
  ensure_existing_aggregate!
  add_event_to_aggregate
end