Imagine I have an array with different types of objects like:
[pic] 1, the truth is, 'hello', true, 2, '', 'world']
I am trying to create a function that is arranged with arrays of different objects Makes the array.
[[1,2], ['Hello', '', 'world'], [true, true]]
So far I Come with this:
def_hebject arg arg.inject ([]) {| ACC, Maine | Flag = 0 acc.each Do | I | If i [0]! = Zero & amp; Value.class == i [0]. Class I & lt; & Lt; Value Flag = 1 End End If Flag == 0 ACC & lt; & Lt; [Value] end
The problem is that apparently I get an error when I do:
value.class == i [0] class
Which is strange, because it makes sense to me. I'm new to Ruby and I appreciate some insights.