Class: HammerCLI::Options::Normalizers::EnumList
- Inherits:
-
AbstractNormalizer
- Object
- AbstractNormalizer
- HammerCLI::Options::Normalizers::EnumList
- Defined in:
- lib/hammer_cli/options/normalizers.rb
Instance Method Summary collapse
- #complete(value) ⇒ Object
- #description ⇒ Object
- #format(value) ⇒ Object
-
#initialize(allowed_values) ⇒ EnumList
constructor
A new instance of EnumList.
Constructor Details
#initialize(allowed_values) ⇒ EnumList
Returns a new instance of EnumList.
275 276 277 |
# File 'lib/hammer_cli/options/normalizers.rb', line 275 def initialize(allowed_values) @allowed_values = allowed_values end |
Instance Method Details
#complete(value) ⇒ Object
287 288 289 |
# File 'lib/hammer_cli/options/normalizers.rb', line 287 def complete(value) Completer::finalize_completions(@allowed_values) end |
#description ⇒ Object
279 280 281 |
# File 'lib/hammer_cli/options/normalizers.rb', line 279 def description _("Any combination (comma separated list) of '%s'") % quoted_values end |
#format(value) ⇒ Object
283 284 285 |
# File 'lib/hammer_cli/options/normalizers.rb', line 283 def format(value) value.is_a?(String) ? parse(value) : [] end |