Handle a Struct-based objects

Since `Struct`-based objects respond to `to_a` (by) and we were using `respond_to?(:to_a)` to check if we’re dealing with an array of objects or a single objects, we have to specifically check for `Struct` inheritance.