Class: HammerCLI::Options::Validators::DSL::AllConstraint
- Inherits:
-
BaseConstraint
- Object
- BaseConstraint
- HammerCLI::Options::Validators::DSL::AllConstraint
- Defined in:
- lib/hammer_cli/options/validators/dsl.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from BaseConstraint
Instance Method Summary collapse
- #exist? ⇒ Boolean
-
#initialize(options, option_values, to_check) ⇒ AllConstraint
constructor
A new instance of AllConstraint.
Methods inherited from BaseConstraint
Constructor Details
#initialize(options, option_values, to_check) ⇒ AllConstraint
Returns a new instance of AllConstraint.
58 59 60 61 62 |
# File 'lib/hammer_cli/options/validators/dsl.rb', line 58 def initialize(, option_values, to_check) super @rejected_msg = _("You can't set all options %s at one time.") @required_msg = _("Options %s are required.") end |
Instance Method Details
#exist? ⇒ Boolean
64 65 66 67 68 69 |
# File 'lib/hammer_cli/options/validators/dsl.rb', line 64 def exist? @to_check.each do |opt| return false unless option_passed?(opt) end return true end |