Class: HammerCLI::Validator::AllConstraint
- Inherits:
-
BaseConstraint
- Object
- BaseConstraint
- HammerCLI::Validator::AllConstraint
- Defined in:
- lib/hammer_cli/validator.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from BaseConstraint
Instance Method Summary collapse
- #exist? ⇒ Boolean
-
#initialize(options, to_check) ⇒ AllConstraint
constructor
A new instance of AllConstraint.
Methods inherited from BaseConstraint
Constructor Details
#initialize(options, to_check) ⇒ AllConstraint
Returns a new instance of AllConstraint.
70 71 72 73 74 |
# File 'lib/hammer_cli/validator.rb', line 70 def initialize(, to_check) super(, to_check) @rejected_msg = _("You can't set all options %s at one time") @required_msg = _("Options %s are required") end |
Instance Method Details
#exist? ⇒ Boolean
76 77 78 79 80 81 |
# File 'lib/hammer_cli/validator.rb', line 76 def exist? @to_check.each do |opt| return false unless option_passed?(opt) end return true end |