Class: ValueSemantics::Either

Inherits:
Object
  • Object
show all
Defined in:
lib/value_semantics.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#subvalidatorsObject (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