Class: StrongerParameters::LessThanOrEqualConstraint
- Inherits:
-
ComparisonConstraints
- Object
- Constraint
- ComparisonConstraints
- StrongerParameters::LessThanOrEqualConstraint
- Defined in:
- lib/stronger_parameters/constraints/comparison_constraints.rb
Instance Attribute Summary
Attributes inherited from ComparisonConstraints
Instance Method Summary collapse
Methods inherited from ComparisonConstraints
Methods inherited from Constraint
#&, #==, #required, #required?, #|
Constructor Details
This class inherits a constructor from StrongerParameters::ComparisonConstraints
Instance Method Details
#value(v) ⇒ Object
31 32 33 34 35 |
# File 'lib/stronger_parameters/constraints/comparison_constraints.rb', line 31 def value(v) return v if v <= limit InvalidValue.new(v, "must be less than or equal to #{limit}") end |