Module: Kibo::CommandLine
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
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
#args ⇒ Object
18
19
20
|
# File 'lib/kibo/commandline.rb', line 18
def args
parse; @args
end
|
#environment ⇒ Object
14
15
16
|
# File 'lib/kibo/commandline.rb', line 14
def environment
parse; @environment
end
|
#options ⇒ Object
6
7
8
|
# File 'lib/kibo/commandline.rb', line 6
def options
parse; @options
end
|
#subcommand ⇒ Object
10
11
12
|
# File 'lib/kibo/commandline.rb', line 10
def subcommand
parse; @subcommand
end
|