Class: CLASP::Arguments::FlagArgument

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

Overview

Class that represents a parsed flag

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argument_specificationObject (readonly)

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



89
90
91
# File 'lib/clasp/arguments.rb', line 89

def argument_specification
  @argument_specification
end

#extrasObject (readonly)

(Object, Hash) The extras associated with the argument



97
98
99
# File 'lib/clasp/arguments.rb', line 97

def extras
  @extras
end

#given_hyphensObject (readonly)

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



91
92
93
# File 'lib/clasp/arguments.rb', line 91

def given_hyphens
  @given_hyphens
end

#given_indexObject (readonly)

(Integer) The command-line index of the argument



85
86
87
# File 'lib/clasp/arguments.rb', line 85

def given_index
  @given_index
end

#given_labelObject (readonly)

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



93
94
95
# File 'lib/clasp/arguments.rb', line 93

def given_label
  @given_label
end

#given_nameObject (readonly)

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



87
88
89
# File 'lib/clasp/arguments.rb', line 87

def given_name
  @given_name
end

#nameObject (readonly)

(String) The resolved name of the argument



95
96
97
# File 'lib/clasp/arguments.rb', line 95

def name
  @name
end

Instance Method Details

#argument_aliasObject

DEPRECATED

Use argument_specification



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

def argument_alias; @argument_specification; end

#hashObject

A hash-code for this instance



131
132
133
134
# File 'lib/clasp/arguments.rb', line 131

def hash

	@arg.hash
end

#to_sObject

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



103
104
105
106
# File 'lib/clasp/arguments.rb', line 103

def to_s

	@name
end