Class: Hashape::Specifiers::Many

Inherits:
Specifier show all
Defined in:
lib/hashape.rb

Overview

Requires that the value be an enumerable, where each item matches the given type spec.

Instance Attribute Summary

Attributes inherited from Specifier

#spec

Instance Method Summary collapse

Methods inherited from Specifier

[], #initialize

Constructor Details

This class inherits a constructor from Hashape::Specifiers::Specifier

Instance Method Details

#===(v) ⇒ Object



56
57
58
# File 'lib/hashape.rb', line 56

def ===(v)
  v.is_a?(Enumerable) && v.all? { |i| self.spec === i }
end