Class: CLASP::Arguments::FlagArgument
- Inherits:
-
Object
- Object
- CLASP::Arguments::FlagArgument
- Defined in:
- lib/clasp/arguments.rb
Overview
Class that represents a parsed flag
Instance Attribute Summary collapse
-
#argument_specification ⇒ Object
readonly
(CLASP::FlagSpecification) 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.
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
.
Instance Attribute Details
#argument_specification ⇒ Object (readonly)
(CLASP::FlagSpecification) The specification matching the argument, or nil
90 91 92 |
# File 'lib/clasp/arguments.rb', line 90 def argument_specification @argument_specification end |
#extras ⇒ Object (readonly)
(Object, Hash) The extras associated with the argument
98 99 100 |
# File 'lib/clasp/arguments.rb', line 98 def extras @extras end |
#given_hyphens ⇒ Object (readonly)
(Integer) The number of hyphens of the argument as it appeared in the command-line
92 93 94 |
# File 'lib/clasp/arguments.rb', line 92 def given_hyphens @given_hyphens end |
#given_index ⇒ Object (readonly)
(Integer) The command-line index of the argument
86 87 88 |
# File 'lib/clasp/arguments.rb', line 86 def given_index @given_index end |
#given_label ⇒ Object (readonly)
(String) The label of the argument as it appeared in the command-line
94 95 96 |
# File 'lib/clasp/arguments.rb', line 94 def given_label @given_label end |
#given_name ⇒ Object (readonly)
(String) The given name of the argument as it appeared in the command-line
88 89 90 |
# File 'lib/clasp/arguments.rb', line 88 def given_name @given_name end |
#name ⇒ Object (readonly)
(String) The resolved name of the argument
96 97 98 |
# File 'lib/clasp/arguments.rb', line 96 def name @name end |
Instance Method Details
#argument_alias ⇒ Object
- DEPRECATED
-
Use
argument_specification
101 |
# File 'lib/clasp/arguments.rb', line 101 def argument_alias; @argument_specification; end |
#hash ⇒ Object
A hash-code for this instance
132 133 134 135 |
# File 'lib/clasp/arguments.rb', line 132 def hash @arg.hash end |
#to_s ⇒ Object
(String) The string form of the flag, which is the same as name
104 105 106 107 |
# File 'lib/clasp/arguments.rb', line 104 def to_s @name end |