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



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

def argument_specification
  @argument_specification
end

#extrasObject (readonly)

(Object, Hash) The extras associated with the argument



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

def extras
  @extras
end

#given_hyphensObject (readonly)

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



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

def given_hyphens
  @given_hyphens
end

#given_indexObject (readonly)

(Integer) The command-line index of the argument



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

def given_index
  @given_index
end

#given_labelObject (readonly)

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



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

def given_label
  @given_label
end

#given_nameObject (readonly)

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



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

def given_name
  @given_name
end

#given_valueObject (readonly)

(String) The given value of the option



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

def given_value
  @given_value
end

#nameObject (readonly)

(String) The resolved name of the argument



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

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



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

def value
  @value
end

Instance Method Details

#argument_aliasObject

DEPRECATED

Use argument_specification



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

def argument_alias; @argument_specification; end

#hashObject

A hash-code for this instance



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

def hash

	@arg.hash
end

#to_sObject

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



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

def to_s

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