Class: Sequent::Generator::Event
- Inherits:
-
Object
- Object
- Sequent::Generator::Event
- Defined in:
- lib/sequent/generator/event.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(name, event, attrs) ⇒ Event
constructor
A new instance of Event.
- #name ⇒ Object
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
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
12 13 14 |
# File 'lib/sequent/generator/event.rb', line 12 def attrs @attrs end |
#event ⇒ Object (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
#execute ⇒ Object
24 25 26 27 |
# File 'lib/sequent/generator/event.rb', line 24 def execute ensure_existing_aggregate! add_event_to_aggregate end |
#name ⇒ Object
20 21 22 |
# File 'lib/sequent/generator/event.rb', line 20 def name @name ||= File.basename(path) end |