Class: Aster::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/aster/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#sublinesObject

Returns the value of attribute sublines.



3
4
5
# File 'lib/aster/command.rb', line 3

def sublines
  @sublines
end

#textObject

Returns the value of attribute text.



3
4
5
# File 'lib/aster/command.rb', line 3

def text
  @text
end

Instance Method Details

#argumentsObject



14
15
16
17
# File 'lib/aster/command.rb', line 14

def arguments
  _, *args = @commands
  args
end

#function_nameObject



19
20
21
# File 'lib/aster/command.rb', line 19

def function_name
  @function_name ||= @commands.first.to_sym
end

#restObject



10
11
12
# File 'lib/aster/command.rb', line 10

def rest
  @text.split(' ', 2)[1]
end