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



168
169
170
# File 'lib/clasp/arguments.rb', line 168

def argument_specification
  @argument_specification
end

#extrasObject (readonly)

(Object, Hash) The extras associated with the argument



178
179
180
# File 'lib/clasp/arguments.rb', line 178

def extras
  @extras
end

#given_hyphensObject (readonly)

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



170
171
172
# File 'lib/clasp/arguments.rb', line 170

def given_hyphens
  @given_hyphens
end

#given_indexObject (readonly)

(Integer) The command-line index of the argument



164
165
166
# File 'lib/clasp/arguments.rb', line 164

def given_index
  @given_index
end

#given_labelObject (readonly)

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



172
173
174
# File 'lib/clasp/arguments.rb', line 172

def given_label
  @given_label
end

#given_nameObject (readonly)

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



166
167
168
# File 'lib/clasp/arguments.rb', line 166

def given_name
  @given_name
end

#nameObject (readonly)

(String) The resolved name of the argument



174
175
176
# File 'lib/clasp/arguments.rb', line 174

def name
  @name
end

#valueObject (readonly)

(String) The value of the option



176
177
178
# File 'lib/clasp/arguments.rb', line 176

def value
  @value
end

Instance Method Details

#argument_aliasObject

DEPRECATED

Use argument_specification



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

def argument_alias; @argument_specification; end

#hashObject

A hash-code for this instance



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

def hash

	@arg.hash
end

#to_sObject

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



212
213
214
215
# File 'lib/clasp/arguments.rb', line 212

def to_s

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