Class: StrongerParameters::RequiredConstraint
- Inherits:
-
Constraint
- Object
- Constraint
- StrongerParameters::RequiredConstraint
- Defined in:
- lib/stronger_parameters/constraint.rb
Instance Method Summary collapse
-
#initialize(other) ⇒ RequiredConstraint
constructor
A new instance of RequiredConstraint.
- #required? ⇒ Boolean
- #value(v) ⇒ Object
Methods inherited from Constraint
Constructor Details
#initialize(other) ⇒ RequiredConstraint
Returns a new instance of RequiredConstraint.
98 99 100 |
# File 'lib/stronger_parameters/constraint.rb', line 98 def initialize(other) @other = other end |
Instance Method Details
#required? ⇒ Boolean
106 107 108 |
# File 'lib/stronger_parameters/constraint.rb', line 106 def required? true end |
#value(v) ⇒ Object
102 103 104 |
# File 'lib/stronger_parameters/constraint.rb', line 102 def value(v) @other.value(v) end |