Class: Strict::Validators::AllOf
- Inherits:
-
Object
- Object
- Strict::Validators::AllOf
- Defined in:
- lib/strict/validators/all_of.rb
Instance Attribute Summary collapse
-
#subvalidators ⇒ Object
readonly
Returns the value of attribute subvalidators.
Instance Method Summary collapse
- #===(value) ⇒ Object
-
#initialize(*subvalidators) ⇒ AllOf
constructor
A new instance of AllOf.
- #inspect ⇒ Object (also: #to_s)
Constructor Details
#initialize(*subvalidators) ⇒ AllOf
Returns a new instance of AllOf.
8 9 10 |
# File 'lib/strict/validators/all_of.rb', line 8 def initialize(*subvalidators) @subvalidators = subvalidators end |
Instance Attribute Details
#subvalidators ⇒ Object (readonly)
Returns the value of attribute subvalidators.
6 7 8 |
# File 'lib/strict/validators/all_of.rb', line 6 def subvalidators @subvalidators end |
Instance Method Details
#===(value) ⇒ Object
12 13 14 15 16 |
# File 'lib/strict/validators/all_of.rb', line 12 def ===(value) subvalidators.all? do |subvalidator| subvalidator === value end end |
#inspect ⇒ Object Also known as: to_s
18 19 20 |
# File 'lib/strict/validators/all_of.rb', line 18 def inspect "AllOf(#{subvalidators.map(&:inspect).join(', ')})" end |