what if you just used inject here:

```ruby
@resource_descriptor.states.inject([]) do |state_array| secondary_descriptor|
  #...
end
```