class Dhall::Util::HashOf
Public Class Methods
new( key_validator, element_validator, min: 0, max: Float::INFINITY )
click to toggle source
# File lib/dhall/util.rb, line 48 def initialize( key_validator, element_validator, min: 0, max: Float::INFINITY ) @min = min @max = max @key_validator = key_validator @element_validator = element_validator end
Public Instance Methods
===(other)
click to toggle source
# File lib/dhall/util.rb, line 60 def ===(other) Hash === other && other.keys.all? { |x| @key_validator === x } && other.values.all? { |x| @element_validator === x } && other.size >= @min && other.size <= @max end