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.



14
15
16
17
18
# File 'lib/sequent/generator/event.rb', line 14

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.



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

def attrs
  @attrs
end

#eventObject (readonly)

Returns the value of attribute event.



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

def event
  @event
end

Instance Method Details

#executeObject



24
25
26
27
# File 'lib/sequent/generator/event.rb', line 24

def execute
  ensure_existing_aggregate!
  add_event_to_aggregate
end

#nameObject



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

def name
  @name ||= File.basename(path)
end