Class: CLASP::Arguments::OptionArgument

Inherits:
Object
  • Object
show all
Defined in:
lib/clasp/arguments.rb

Overview

Class that represents a parsed option

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argument_specificationObject (readonly)

(CLASP::OptionSpecification) The specification matching the argument, or nil



194
195
196
# File 'lib/clasp/arguments.rb', line 194

def argument_specification
  @argument_specification
end

#extrasObject (readonly)

(Object, Hash) The extras associated with the argument



206
207
208
# File 'lib/clasp/arguments.rb', line 206

def extras
  @extras
end

#given_hyphensObject (readonly)

(Integer) The number of hyphens of the argument as it appeared in the command-line



196
197
198
# File 'lib/clasp/arguments.rb', line 196

def given_hyphens
  @given_hyphens
end

#given_indexObject (readonly)

(Integer) The command-line index of the argument



190
191
192
# File 'lib/clasp/arguments.rb', line 190

def given_index
  @given_index
end

#given_labelObject (readonly)

(String) The label of the argument as it appeared in the command-line



198
199
200
# File 'lib/clasp/arguments.rb', line 198

def given_label
  @given_label
end

#given_nameObject (readonly)

(String) The given name of the argument as it appeared in the command-line



192
193
194
# File 'lib/clasp/arguments.rb', line 192

def given_name
  @given_name
end

#given_valueObject (readonly)

(String) The given value of the option



202
203
204
# File 'lib/clasp/arguments.rb', line 202

def given_value
  @given_value
end

#nameObject (readonly)

(String) The resolved name of the argument



200
201
202
# File 'lib/clasp/arguments.rb', line 200

def name
  @name
end

#valueObject (readonly)

(????) The value of the option, which may be of a type other than string subject to the option specification’s constraint



204
205
206
# File 'lib/clasp/arguments.rb', line 204

def value
  @value
end

Instance Method Details

#argument_aliasObject

DEPRECATED

Use argument_specification



209
# File 'lib/clasp/arguments.rb', line 209

def argument_alias; @argument_specification; end

#hashObject

A hash-code for this instance



234
235
236
237
# File 'lib/clasp/arguments.rb', line 234

def hash

    @arg.hash
end

#to_sObject

(String) The string form of the flag, which is the same as name=value



240
241
242
243
# File 'lib/clasp/arguments.rb', line 240

def to_s

    "#{name}=#{value}"
end