Module: Kibo::CommandLine

Extended by:
CommandLine
Included in:
CommandLine
Defined in:
lib/kibo/commandline.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object (private)



96
97
98
99
100
101
102
103
104
105
106
# File 'lib/kibo/commandline.rb', line 96

def method_missing(sym, *args, &block)
  if block_given? || !args.empty?
    super
  elsif options.key?(sym)
    options[sym]
  elsif (sym.to_s =~ /(.*)\?/) && options.key?($1.to_sym)
    !! options[$1.to_sym]
  else
    super
  end 
end

Instance Method Details

#argsObject



18
19
20
# File 'lib/kibo/commandline.rb', line 18

def args
  parse; @args
end

#environmentObject



14
15
16
# File 'lib/kibo/commandline.rb', line 14

def environment
  parse; @environment
end

#optionsObject



6
7
8
# File 'lib/kibo/commandline.rb', line 6

def options
  parse; @options
end

#subcommandObject



10
11
12
# File 'lib/kibo/commandline.rb', line 10

def subcommand
  parse; @subcommand
end