Class: Recheck::Optimist::DependConstraint

Inherits:
Constraint
  • Object
show all
Defined in:
lib/recheck/vendor/optimist.rb

Overview

A Dependency constraint. Useful when Option A requires Option B also be used.

Instance Method Summary collapse

Methods inherited from Constraint

#initialize, #validate

Constructor Details

This class inherits a constructor from Recheck::Optimist::Constraint

Instance Method Details

#error_condition(overlap_size) ⇒ Object



67
68
69
# File 'lib/recheck/vendor/optimist.rb', line 67

def error_condition(overlap_size)
  (overlap_size != 0) && (overlap_size != @idents.size)
end

#error_message(longargs) ⇒ Object



71
72
73
# File 'lib/recheck/vendor/optimist.rb', line 71

def error_message(longargs)
  "#{longargs.join(", ")} have a dependency and must be given together"
end