class Aster::Command
Attributes
sub_commands[RW]
sub_text[RW]
text[RW]
Public Class Methods
new(commands, subcommands = [])
click to toggle source
# File lib/aster/command.rb, line 5 def initialize(commands, subcommands = []) @commands = make_commands commands @sub_commands = sub_commands end
Public Instance Methods
arguments()
click to toggle source
# File lib/aster/command.rb, line 10 def arguments @commands[1..-1] end
function_name()
click to toggle source
# File lib/aster/command.rb, line 14 def function_name @function_name ||= @commands.first.to_sym end
Private Instance Methods
make_commands(cmds)
click to toggle source
# File lib/aster/command.rb, line 20 def make_commands(cmds) cmds.map do |cmd| if cmd.is_a?(Array) Command.new(cmd) else cmd end end end