Class: CommandBuilder::CodeGenerator::Command
- Defined in:
- lib/command_builder/code_generator/command.rb
Instance Attribute Summary collapse
-
#command_name ⇒ Object
readonly
Returns the value of attribute command_name.
Instance Method Summary collapse
-
#initialize(command_def) ⇒ Command
constructor
A new instance of Command.
- #node_name ⇒ Object
Methods inherited from Node
#args, #branch?, #child_nodes, #fragments, #leaf?
Constructor Details
#initialize(command_def) ⇒ Command
Returns a new instance of Command.
11 12 13 14 15 16 17 18 19 |
# File 'lib/command_builder/code_generator/command.rb', line 11 def initialize(command_def) hash = Command.command_hash command_def command_text = hash.keys[0] command_name = Command.command_name command_text node_def = command_text[command_name.length, command_text.length] super node_def Command.process_array hash.values[0], self @command_name = command_name end |
Instance Attribute Details
#command_name ⇒ Object (readonly)
Returns the value of attribute command_name.
9 10 11 |
# File 'lib/command_builder/code_generator/command.rb', line 9 def command_name @command_name end |
Instance Method Details
#node_name ⇒ Object
21 22 23 |
# File 'lib/command_builder/code_generator/command.rb', line 21 def node_name @node_name ||= node_alias || @command_name end |