U
Une Bévue
I've found in case / when if the case is about a class :
case my_var.class
when String then puts my_var
when Array then my_var.each {|v| puts v}
end
doesn't work i do have to use :
case my_var.class.to_s
when 'String' then puts my_var
when 'Array' then my_var.each {|v| puts v}
end
why ?
(with ruby 1.9.x)
case my_var.class
when String then puts my_var
when Array then my_var.each {|v| puts v}
end
doesn't work i do have to use :
case my_var.class.to_s
when 'String' then puts my_var
when 'Array' then my_var.each {|v| puts v}
end
why ?
(with ruby 1.9.x)