L
Luke A. Kanies
If I run the following code:
if Hash === Hash
puts "yup"
end
I get no output. From what I can tell, this means that I can't test
constants in a when statement. I need something like the following:
array.each { |member|
case member.class
when Object::Subclass
next
end
stuff
}
and if I can't test the equality of constants with === (which is what
'when' uses; why is it a separate operator?), then I can't use them as
values in a when statement. How do I do this?
Thanks,
Luke
if Hash === Hash
puts "yup"
end
I get no output. From what I can tell, this means that I can't test
constants in a when statement. I need something like the following:
array.each { |member|
case member.class
when Object::Subclass
next
end
stuff
}
and if I can't test the equality of constants with === (which is what
'when' uses; why is it a separate operator?), then I can't use them as
values in a when statement. How do I do this?
Thanks,
Luke