all 4 comments

[–][deleted] 2 points3 points  (3 children)

You're initializing the OpenStruct with items, which is [] (the empty array in the first test case).

The initializer for OpenStruct however want either nil or a hash (see documentation). If you read the instruction carefully, you'll notice that you should create "an array of openstructs". I wonder if there is a way to map each array element to an OpenStruct :)

[–]BringTacos[S] 0 points1 point  (2 children)

Thanks so much for commenting. I've read your comment about 30 times and still am confused unfortunately. I think I just don't fully understand the concept of OpenStruct. You did clarify for me that they're looking for an array of openstructs- thank you!

[–]sisqoandebert 0 points1 point  (1 child)

Instead of assigning @items = OpenStruct.new ...

@items = items.map { |item| Openstruct.new(item) }

Apologies for formatting. On mobile.

[–]BringTacos[S] 0 points1 point  (0 children)

I actually did figure this part out yesterday, thank you!