Class: Aster::Command
- Inherits:
-
Object
- Object
- Aster::Command
- Defined in:
- lib/aster/command.rb
Instance Attribute Summary collapse
-
#sublines ⇒ Object
Returns the value of attribute sublines.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #arguments ⇒ Object
- #function_name ⇒ Object
-
#initialize(commands, sublines = []) ⇒ Command
constructor
A new instance of Command.
- #rest ⇒ Object
Constructor Details
#initialize(commands, sublines = []) ⇒ Command
Returns a new instance of Command.
5 6 7 8 |
# File 'lib/aster/command.rb', line 5 def initialize(commands, sublines = []) @commands = commands @sublines = sublines end |
Instance Attribute Details
#sublines ⇒ Object
Returns the value of attribute sublines.
3 4 5 |
# File 'lib/aster/command.rb', line 3 def sublines @sublines 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
14 15 16 17 |
# File 'lib/aster/command.rb', line 14 def arguments _, *args = @commands args end |
#function_name ⇒ Object
19 20 21 |
# File 'lib/aster/command.rb', line 19 def function_name @function_name ||= @commands.first.to_sym end |
#rest ⇒ Object
10 11 12 |
# File 'lib/aster/command.rb', line 10 def rest @text.split(' ', 2)[1] end |