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
14
15
16
|
# File 'lib/stronger_parameters/constraint.rb', line 14
def &(other)
AndConstraint.new(self, other)
end
|
#==(other) ⇒ Object
18
19
20
|
# File 'lib/stronger_parameters/constraint.rb', line 18
def ==(other)
self.class == other.class
end
|
#required ⇒ Object
22
23
24
|
# File 'lib/stronger_parameters/constraint.rb', line 22
def required
RequiredConstraint.new(self)
end
|
#required? ⇒ Boolean
26
27
28
|
# File 'lib/stronger_parameters/constraint.rb', line 26
def required?
false
end
|
#value(v) ⇒ Object
6
7
8
|
# File 'lib/stronger_parameters/constraint.rb', line 6
def value(v)
v
end
|
#|(other) ⇒ Object
10
11
12
|
# File 'lib/stronger_parameters/constraint.rb', line 10
def |(other)
OrConstraint.new(self, other)
end
|