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.



18
19
20
21
22
# File 'lib/dhall/util.rb', line 18

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

Instance Method Details

#===(other) ⇒ Object



24
25
26
# File 'lib/dhall/util.rb', line 24

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