Class: Sequent::Generator::Command

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, command, attrs) ⇒ Command

Returns a new instance of Command.



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

def initialize(name, command, attrs)
  @name = name
  @command = command
  @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/command.rb', line 12

def attrs
  @attrs
end

#commandObject (readonly)

Returns the value of attribute command.



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

def command
  @command
end

Instance Method Details

#executeObject



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

def execute
  ensure_existing_aggregate!
  add_command_to_aggregate
end