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.



12
13
14
15
# File 'lib/choosy/command.rb', line 12

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

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



9
10
11
# File 'lib/choosy/command.rb', line 9

def arguments
  @arguments
end

#executorObject

Returns the value of attribute executor.



9
10
11
# File 'lib/choosy/command.rb', line 9

def executor
  @executor
end

#parentObject

Returns the value of attribute parent.



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

def parent
  @parent
end

Instance Method Details

#subcommand?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/choosy/command.rb', line 23

def subcommand?
  !@parent.nil?
end