Class: StrongerParameters::Constraint
- Inherits:
-
Object
- Object
- StrongerParameters::Constraint
show all
- Defined in:
- lib/stronger_parameters/constraint.rb
Direct Known Subclasses
AndConstraint, ArrayConstraint, BooleanConstraint, ComparisonConstraints, DateConstraint, DateIso8601Constraint, DateTimeConstraint, DateTimeIso8601Constraint, DecimalConstraint, EnumerationConstraint, FileConstraint, FloatConstraint, HashConstraint, HexConstraint, IntegerConstraint, NilConstraint, NilStringConstraint, OrConstraint, RegexpConstraint, RequiredConstraint, StringConstraint, TimeConstraint, TimeIso8601Constraint, UlidConstraint
Instance Method Summary
collapse
Instance Method Details
#&(other) ⇒ Object
15
16
17
|
# File 'lib/stronger_parameters/constraint.rb', line 15
def &(other)
AndConstraint.new(self, other)
end
|
#==(other) ⇒ Object
19
20
21
|
# File 'lib/stronger_parameters/constraint.rb', line 19
def ==(other)
self.class == other.class
end
|
#required ⇒ Object
23
24
25
|
# File 'lib/stronger_parameters/constraint.rb', line 23
def required
RequiredConstraint.new(self)
end
|
#required? ⇒ Boolean
27
28
29
|
# File 'lib/stronger_parameters/constraint.rb', line 27
def required?
false
end
|
#value(v) ⇒ Object
7
8
9
|
# File 'lib/stronger_parameters/constraint.rb', line 7
def value(v)
v
end
|
#|(other) ⇒ Object
11
12
13
|
# File 'lib/stronger_parameters/constraint.rb', line 11
def |(other)
OrConstraint.new(self, other)
end
|