Class: StrongerParameters::RequiredConstraint

Inherits:
Constraint
  • Object
show all
Defined in:
lib/stronger_parameters/constraint.rb

Instance Method Summary collapse

Methods inherited from Constraint

#&, #==, #required, #|

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

Returns:

  • (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