Class: Choosy::Command

Inherits:
BaseCommand show all
Defined in:
lib/choosy/command.rb

Instance Attribute Summary collapse

Attributes inherited from BaseCommand

#builder, #listing, #name, #option_builders, #printer, #summary

Instance Method Summary collapse

Methods inherited from BaseCommand

#alter, #execute!, #finalize!, #options, #parse!

Constructor Details

#initialize(name, supercommand = nil) ⇒ Command

Returns a new instance of Command.



6
7
8
9
# File 'lib/choosy/command.rb', line 6

def initialize(name, supercommand=nil)
  super(name)
  self.parent = supercommand
end

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



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

def arguments
  @arguments
end

#executorObject

Returns the value of attribute executor.



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

def executor
  @executor
end

#parentObject

Returns the value of attribute parent.



4
5
6
# File 'lib/choosy/command.rb', line 4

def parent
  @parent
end

Instance Method Details

#subcommand?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/choosy/command.rb', line 17

def subcommand?
  !@parent.nil?
end