Class: Optitron::Option::Cmd

Inherits:
Optitron::Option show all
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

Attributes inherited from Optitron::Option

#default, #desc, #group, #has_default, #inclusion_test, #name, #parameterize, #required, #type

Instance Method Summary collapse

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

#argsObject (readonly)

Returns the value of attribute args.



188
189
190
# File 'lib/optitron/option.rb', line 188

def args
  @args
end

#optionsObject (readonly)

Returns the value of attribute options.



188
189
190
# File 'lib/optitron/option.rb', line 188

def options
  @options
end

#runObject (readonly)

Returns the value of attribute run.



188
189
190
# File 'lib/optitron/option.rb', line 188

def run
  @run
end