Class: Toys::Flag::Resolution
- Inherits:
-
Object
- Object
- Toys::Flag::Resolution
- Defined in:
- core-docs/toys/flag.rb
Overview
Defined in the toys-core gem
The result of looking up a flag by name.
Instance Attribute Summary collapse
-
#string ⇒ String
readonly
The flag string that was looked up.
Instance Method Summary collapse
-
#count ⇒ Integer
The number of matches that were found.
-
#found_exact? ⇒ Boolean
Whether an exact match of the string was found.
-
#found_multiple? ⇒ Boolean
Whether multiple matches were found (i.e. ambiguous input).
-
#found_unique? ⇒ Boolean
Whether a single unique match was found.
-
#matching_flag_strings ⇒ Array<String>
Returns an array of the matching full flag strings.
-
#not_found? ⇒ Boolean
Whether no matches were found.
-
#unique_flag ⇒ Toys::Flag?
Return the unique Toys::Flag, or
nil
if not found or not unique. -
#unique_flag_negative? ⇒ Boolean?
Return whether the unique match was a hit on the negative (
--no-*
) case, ornil
if not found or not unique. -
#unique_flag_syntax ⇒ Toys::Flag::Syntax?
Return the unique Syntax, or
nil
if not found or not unique.
Instance Attribute Details
#string ⇒ String (readonly)
The flag string that was looked up
126 127 128 |
# File 'core-docs/toys/flag.rb', line 126 def string @string end |
Instance Method Details
#count ⇒ Integer
The number of matches that were found.
140 141 142 |
# File 'core-docs/toys/flag.rb', line 140 def count # Source available in the toys-core gem end |
#found_exact? ⇒ Boolean
Whether an exact match of the string was found
132 133 134 |
# File 'core-docs/toys/flag.rb', line 132 def found_exact? # Source available in the toys-core gem end |
#found_multiple? ⇒ Boolean
Whether multiple matches were found (i.e. ambiguous input).
164 165 166 |
# File 'core-docs/toys/flag.rb', line 164 def found_multiple? # Source available in the toys-core gem end |
#found_unique? ⇒ Boolean
Whether a single unique match was found.
148 149 150 |
# File 'core-docs/toys/flag.rb', line 148 def found_unique? # Source available in the toys-core gem end |
#matching_flag_strings ⇒ Array<String>
Returns an array of the matching full flag strings.
199 200 201 |
# File 'core-docs/toys/flag.rb', line 199 def matching_flag_strings # Source available in the toys-core gem end |
#not_found? ⇒ Boolean
Whether no matches were found.
156 157 158 |
# File 'core-docs/toys/flag.rb', line 156 def not_found? # Source available in the toys-core gem end |
#unique_flag ⇒ Toys::Flag?
Return the unique Toys::Flag, or nil
if not found or
not unique.
173 174 175 |
# File 'core-docs/toys/flag.rb', line 173 def unique_flag # Source available in the toys-core gem end |
#unique_flag_negative? ⇒ Boolean?
Return whether the unique match was a hit on the negative (--no-*
)
case, or nil
if not found or not unique.
191 192 193 |
# File 'core-docs/toys/flag.rb', line 191 def unique_flag_negative? # Source available in the toys-core gem end |
#unique_flag_syntax ⇒ Toys::Flag::Syntax?
Return the unique Syntax, or nil
if not found
or not unique.
182 183 184 |
# File 'core-docs/toys/flag.rb', line 182 def unique_flag_syntax # Source available in the toys-core gem end |