Class | Amazon::AWS::AWSArray |
In: |
lib/amazon/aws.rb
|
Parent: | Array |
Everything we get back from AWS is transformed into an array. Many of these, however, have only one element, because the corresponding XML consists of a parent element containing only a single child element.
This class consists solely to allow single element arrays to pass a method call down to their one element, thus obviating the need for lots of references to foo[0] in user code.
For example, the following:
items = resp.item_search_response[0].items[0].item
can be reduced to:
items = resp.item_search_response.items.item
to_s | -> | to_str |