Class: ValueSemantics::Either
- Inherits:
-
Object
- Object
- ValueSemantics::Either
- Defined in:
- lib/value_semantics.rb
Instance Attribute Summary collapse
-
#subvalidators ⇒ Object
readonly
Returns the value of attribute subvalidators.
Instance Method Summary collapse
- #===(value) ⇒ Object
-
#initialize(subvalidators) ⇒ Either
constructor
A new instance of Either.
Constructor Details
#initialize(subvalidators) ⇒ Either
Returns a new instance of Either.
212 213 214 215 |
# File 'lib/value_semantics.rb', line 212 def initialize(subvalidators) @subvalidators = subvalidators freeze end |
Instance Attribute Details
#subvalidators ⇒ Object (readonly)
Returns the value of attribute subvalidators.
210 211 212 |
# File 'lib/value_semantics.rb', line 210 def subvalidators @subvalidators end |
Instance Method Details
#===(value) ⇒ Object
217 218 219 |
# File 'lib/value_semantics.rb', line 217 def ===(value) subvalidators.any? { |sv| sv === value } end |