Class: Aster::Command
- Inherits:
-
Object
- Object
- Aster::Command
- Defined in:
- lib/aster/command.rb
Instance Attribute Summary collapse
-
#sub_commands ⇒ Object
Returns the value of attribute sub_commands.
-
#sub_text ⇒ Object
Returns the value of attribute sub_text.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #arguments ⇒ Object
- #function_name ⇒ Object
-
#initialize(commands, subcommands = []) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(commands, subcommands = []) ⇒ Command
Returns a new instance of Command.
5 6 7 8 |
# File 'lib/aster/command.rb', line 5 def initialize(commands, subcommands = []) @commands = make_commands commands @sub_commands = sub_commands end |
Instance Attribute Details
#sub_commands ⇒ Object
Returns the value of attribute sub_commands.
3 4 5 |
# File 'lib/aster/command.rb', line 3 def sub_commands @sub_commands end |
#sub_text ⇒ Object
Returns the value of attribute sub_text.
3 4 5 |
# File 'lib/aster/command.rb', line 3 def sub_text @sub_text end |
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/aster/command.rb', line 3 def text @text end |
Instance Method Details
#arguments ⇒ Object
10 11 12 |
# File 'lib/aster/command.rb', line 10 def arguments @commands[1..-1] end |
#function_name ⇒ Object
14 15 16 |
# File 'lib/aster/command.rb', line 14 def function_name @function_name ||= @commands.first.to_sym end |