Class: Typeguard::Validation::UnionOf

Inherits:
Base
  • Object
show all
Defined in:
lib/typeguard/types.rb

Instance Method Summary collapse

Methods inherited from Base

from

Constructor Details

#initialize(children) ⇒ UnionOf

Returns a new instance of UnionOf.



168
169
170
# File 'lib/typeguard/types.rb', line 168

def initialize(children)
  @children = children
end

Instance Method Details

#valid?(value) ⇒ Boolean

Returns:

  • (Boolean)


172
173
174
# File 'lib/typeguard/types.rb', line 172

def valid?(value)
  @children.any? { |v| v.valid?(value) }
end