Class: Sequent::Generator::Command
- Inherits:
-
Object
- Object
- Sequent::Generator::Command
- Defined in:
- lib/sequent/generator/command.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(name, command, attrs) ⇒ Command
constructor
A new instance of Command.
- #name ⇒ Object
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
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
14 15 16 |
# File 'lib/sequent/generator/command.rb', line 14 def attrs @attrs end |
#command ⇒ Object (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
#execute ⇒ Object
22 23 24 25 |
# File 'lib/sequent/generator/command.rb', line 22 def execute ensure_existing_aggregate! add_command_to_aggregate end |
#name ⇒ Object
27 28 29 |
# File 'lib/sequent/generator/command.rb', line 27 def name @name ||= File.basename(path) end |