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.



97
98
99
# File 'lib/stronger_parameters/constraint.rb', line 97

def initialize(other)
  @other = other
end

Instance Method Details

#required?Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/stronger_parameters/constraint.rb', line 105

def required?
  true
end

#value(v) ⇒ Object



101
102
103
# File 'lib/stronger_parameters/constraint.rb', line 101

def value(v)
  @other.value(v)
end