Class: Optitron::Option::Cmd
- Inherits:
-
Optitron::Option
- Object
- Optitron::Option
- Optitron::Option::Cmd
- Defined in:
- lib/optitron/option.rb
Constant Summary
Constants inherited from Optitron::Option
BOOLEAN_VALUES, FALSE_BOOLEAN_VALUES, TRUE_BOOLEAN_VALUES
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#run ⇒ Object
readonly
Returns the value of attribute run.
Attributes inherited from Optitron::Option
#default, #desc, #group, #has_default, #inclusion_test, #name, #parameterize, #required, #type
Instance Method Summary collapse
-
#initialize(name, desc = nil, opts = nil) ⇒ Cmd
constructor
A new instance of Cmd.
Methods inherited from Optitron::Option
#any?, #array?, #boolean?, #greedy?, #hash?, #interpolate_type, #numeric?, #string?, #validate
Constructor Details
#initialize(name, desc = nil, opts = nil) ⇒ Cmd
Returns a new instance of Cmd.
189 190 191 192 193 194 195 196 197 198 |
# File 'lib/optitron/option.rb', line 189 def initialize(name, desc = nil, opts = nil) if desc.is_a?(Hash) desc, opts = nil, desc end @name, @desc = name, desc @run = opts[:run] if opts && opts[:run] @group = opts[:group] if opts && opts[:group] @options = [] @args = [] end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
188 189 190 |
# File 'lib/optitron/option.rb', line 188 def args @args end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
188 189 190 |
# File 'lib/optitron/option.rb', line 188 def @options end |
#run ⇒ Object (readonly)
Returns the value of attribute run.
188 189 190 |
# File 'lib/optitron/option.rb', line 188 def run @run end |