Class: Optimist::EitherConstraint
- Inherits:
-
Constraint
- Object
- Constraint
- Optimist::EitherConstraint
- Defined in:
- lib/optimist.rb
Overview
An Either-Or constraint. For Mutually exclusive options
Instance Method Summary collapse
Methods inherited from Constraint
Constructor Details
This class inherits a constructor from Optimist::Constraint
Instance Method Details
#error_condition(overlap_size) ⇒ Object
76 77 78 |
# File 'lib/optimist.rb', line 76 def error_condition(overlap_size) overlap_size != 1 end |
#error_message(longargs) ⇒ Object
79 80 81 |
# File 'lib/optimist.rb', line 79 def (longargs) "one and only one of #{longargs.join(', ')} is required" end |