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, 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_commandsObject

Returns the value of attribute sub_commands.



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

def sub_commands
  @sub_commands
end

#sub_textObject

Returns the value of attribute sub_text.



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

def sub_text
  @sub_text
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



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

def arguments
  @commands[1..-1]
end

#function_nameObject



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

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