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.
60 61 62 63 64 |
# File 'lib/hammer_cli/validator.rb', line 60 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
66 67 68 69 70 71 |
# File 'lib/hammer_cli/validator.rb', line 66 def exist? @to_check.each do |opt| return false unless option_passed?(opt) end return true end |