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.



16
17
18
19
20
# File 'lib/dhall/util.rb', line 16

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

Instance Method Details

#===(other) ⇒ Object



22
23
24
# File 'lib/dhall/util.rb', line 22

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