Class: CLASP::Arguments::OptionArgument
- Inherits:
-
Object
- Object
- CLASP::Arguments::OptionArgument
- Defined in:
- lib/clasp/arguments.rb
Overview
Class that represents a parsed option
Instance Attribute Summary collapse
-
#argument_specification ⇒ Object
readonly
(CLASP::OptionSpecification) The specification matching the argument, or
nil
. -
#extras ⇒ Object
readonly
(Object, Hash) The extras associated with the argument.
-
#given_hyphens ⇒ Object
readonly
(Integer) The number of hyphens of the argument as it appeared in the command-line.
-
#given_index ⇒ Object
readonly
(Integer) The command-line index of the argument.
-
#given_label ⇒ Object
readonly
(String) The label of the argument as it appeared in the command-line.
-
#given_name ⇒ Object
readonly
(String) The given name of the argument as it appeared in the command-line.
-
#name ⇒ Object
readonly
(String) The resolved name of the argument.
-
#value ⇒ Object
readonly
(String) The value of the option.
Instance Method Summary collapse
-
#argument_alias ⇒ Object
- DEPRECATED
-
Use
argument_specification
.
-
#hash ⇒ Object
A hash-code for this instance.
-
#to_s ⇒ Object
(String) The string form of the flag, which is the same as
name
=value
.
Instance Attribute Details
#argument_specification ⇒ Object (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 |
#extras ⇒ Object (readonly)
(Object, Hash) The extras associated with the argument
178 179 180 |
# File 'lib/clasp/arguments.rb', line 178 def extras @extras end |
#given_hyphens ⇒ Object (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_index ⇒ Object (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_label ⇒ Object (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_name ⇒ Object (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 |
#name ⇒ Object (readonly)
(String) The resolved name of the argument
174 175 176 |
# File 'lib/clasp/arguments.rb', line 174 def name @name end |
#value ⇒ Object (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_alias ⇒ Object
- DEPRECATED
-
Use
argument_specification
181 |
# File 'lib/clasp/arguments.rb', line 181 def argument_alias; @argument_specification; end |
#hash ⇒ Object
A hash-code for this instance
206 207 208 209 |
# File 'lib/clasp/arguments.rb', line 206 def hash @arg.hash end |
#to_s ⇒ Object
(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 |