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.



16
17
18
19
20
# File 'lib/sequent/generator/command.rb', line 16

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.



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

def attrs
  @attrs
end

#commandObject (readonly)

Returns the value of attribute command.



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

def command
  @command
end

Instance Method Details

#executeObject



22
23
24
25
# File 'lib/sequent/generator/command.rb', line 22

def execute
  ensure_existing_aggregate!
  add_command_to_aggregate
end

#nameObject



27
28
29
# File 'lib/sequent/generator/command.rb', line 27

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