Class: Dhall::Util::ArrayOf

Inherits:
ValueSemantics::ArrayOf
  • Object
show all
Defined in:
lib/dhall/util.rb

Instance Method Summary collapse

Constructor Details

#initialize(element_validator, min: 0, max: Float::INFINITY) ⇒ ArrayOf

Returns a new instance of ArrayOf.



36
37
38
39
40
# File 'lib/dhall/util.rb', line 36

def initialize(element_validator, min: 0, max: Float::INFINITY)
	@min = min
	@max = max
	super(element_validator)
end

Instance Method Details

#===(other) ⇒ Object



42
43
44
# File 'lib/dhall/util.rb', line 42

def ===(other)
	super && other.length >= @min && other.length <= @max
end