Class: Typeguard::Validation::Generic
- Defined in:
- lib/typeguard/types.rb
Instance Method Summary collapse
-
#initialize(node) ⇒ Generic
constructor
A new instance of Generic.
- #valid?(value) ⇒ Boolean
Methods inherited from Base
Constructor Details
Instance Method Details
#valid?(value) ⇒ Boolean
56 57 58 59 60 61 62 |
# File 'lib/typeguard/types.rb', line 56 def valid?(value) return false unless value.is_a?(@klass) value.all? do |element| @children.any? { |child| child.valid?(element) } end end |