Class: Typeguard::Validation::Fixed
Instance Method Summary collapse
-
#initialize(node) ⇒ Fixed
constructor
A new instance of Fixed.
- #valid?(value) ⇒ Boolean
Methods inherited from Base
Constructor Details
Instance Method Details
#valid?(value) ⇒ Boolean
71 72 73 74 75 76 77 78 |
# File 'lib/typeguard/types.rb', line 71 def valid?(value) return false unless value.is_a?(@klass) return false unless value.size == @children.size @children.each_with_index.all? do |child, i| child.valid?(value[i]) end end |