Method: Uinit::Type::SetOf#check!

Defined in:
lib/uinit/type/set_of.rb

#check!(value, depth) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/uinit/type/set_of.rb', line 22

def check!(value, depth)
  type_error!("#{value.inspect} must be a Set", depth) unless value.is_a?(::Set)

  value.each_with_index do |val, index|
    type.check!(val, depth + 1)
  rescue Error => e
    trace!(e, "[#{index}]")
  end

  value
end