I have
arrs = [[:key1, key2, key3, key4],[:key6, key7]]
And I want to define Struct by using those keys like this:
arrs.map do |arr|
Struct.new(arr)
end
but it does raise an error:
TypeError: no implicit conversion of Array into String
from (irb):26:in `new'
from (irb):26
So, do we have any way to initialize these keys in Struct?
testhave to do with it? Why are you assigning totestand then never ever using the result?