Class: HammerCLI::Options::Validators::DSL::OneOptionConstraint
- Inherits:
-
AllConstraint
- Object
- BaseConstraint
- AllConstraint
- HammerCLI::Options::Validators::DSL::OneOptionConstraint
- Defined in:
- lib/hammer_cli/options/validators/dsl.rb
Instance Attribute Summary
Attributes inherited from BaseConstraint
Instance Method Summary collapse
-
#initialize(options, option_values, to_check) ⇒ OneOptionConstraint
constructor
A new instance of OneOptionConstraint.
- #value ⇒ Object
Methods inherited from AllConstraint
Methods inherited from BaseConstraint
Constructor Details
#initialize(options, option_values, to_check) ⇒ OneOptionConstraint
Returns a new instance of OneOptionConstraint.
73 74 75 76 77 |
# File 'lib/hammer_cli/options/validators/dsl.rb', line 73 def initialize(, option_values, to_check) super(, option_values, [to_check]) @rejected_msg = _("You can't set option %s.") @required_msg = _("Option %s is required.") end |
Instance Method Details
#value ⇒ Object
79 80 81 |
# File 'lib/hammer_cli/options/validators/dsl.rb', line 79 def value get_option_value(@to_check[0]) end |