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.
-
#given_value ⇒ Object
readonly
(String) The given value of the option.
-
#name ⇒ Object
readonly
(String) The resolved name of the argument.
-
#value ⇒ Object
readonly
(????) The value of the option, which may be of a type other than string subject to the option specification’s constraint.
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
194 195 196 |
# File 'lib/clasp/arguments.rb', line 194 def argument_specification @argument_specification end |
#extras ⇒ Object (readonly)
(Object, Hash) The extras associated with the argument
206 207 208 |
# File 'lib/clasp/arguments.rb', line 206 def extras @extras end |
#given_hyphens ⇒ Object (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_index ⇒ Object (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_label ⇒ Object (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_name ⇒ Object (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_value ⇒ Object (readonly)
(String) The given value of the option
202 203 204 |
# File 'lib/clasp/arguments.rb', line 202 def given_value @given_value end |
#name ⇒ Object (readonly)
(String) The resolved name of the argument
200 201 202 |
# File 'lib/clasp/arguments.rb', line 200 def name @name end |
#value ⇒ Object (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_alias ⇒ Object
- DEPRECATED
-
Use
argument_specification
209 |
# File 'lib/clasp/arguments.rb', line 209 def argument_alias; @argument_specification; end |
#hash ⇒ Object
A hash-code for this instance
234 235 236 237 |
# File 'lib/clasp/arguments.rb', line 234 def hash @arg.hash end |
#to_s ⇒ Object
(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 |