Class: OptParseValidator::OptAlias
- Defined in:
- lib/opt_parse_validator/opts/alias.rb
Overview
Implementation of the Alias Option
Instance Attribute Summary
Attributes inherited from OptBase
Instance Method Summary collapse
- #alias? ⇒ Boolean
- #alias_for ⇒ String
- #append_help_messages ⇒ Object
-
#initialize(option, attrs = {}) ⇒ OptAlias
constructor
A new instance of OptAlias.
Methods inherited from OptBase
#advanced?, #choices, #default, #help_message_for_default, #help_messages, #normalize, #required?, #required_unless, #to_long, #to_s, #to_sym, #validate, #value_if_empty
Constructor Details
Instance Method Details
#alias? ⇒ Boolean
24 25 26 |
# File 'lib/opt_parse_validator/opts/alias.rb', line 24 def alias? true end |
#alias_for ⇒ String
19 20 21 |
# File 'lib/opt_parse_validator/opts/alias.rb', line 19 def alias_for @alias_for ||= attrs[:alias_for] end |
#append_help_messages ⇒ Object
12 13 14 15 16 |
# File 'lib/opt_parse_validator/opts/alias.rb', line 12 def super option << "Alias for #{alias_for}" end |