Class: Cetacean::EmbeddedResourceCollection
- Inherits:
-
Object
- Object
- Cetacean::EmbeddedResourceCollection
- Includes:
- Enumerable
- Defined in:
- lib/cetacean/embedded_resource_collection.rb
Instance Method Summary collapse
- #[](index) ⇒ Object
- #each ⇒ Object
-
#initialize(document_array) ⇒ EmbeddedResourceCollection
constructor
A new instance of EmbeddedResourceCollection.
Constructor Details
#initialize(document_array) ⇒ EmbeddedResourceCollection
Returns a new instance of EmbeddedResourceCollection.
4 5 6 |
# File 'lib/cetacean/embedded_resource_collection.rb', line 4 def initialize(document_array) @document_array = document_array end |
Instance Method Details
#[](index) ⇒ Object
14 15 16 |
# File 'lib/cetacean/embedded_resource_collection.rb', line 14 def [](index) Cetacean::EmbeddedResource.new(document_array[index]) end |
#each ⇒ Object
8 9 10 11 12 |
# File 'lib/cetacean/embedded_resource_collection.rb', line 8 def each document_array.each do |document| yield Cetacean::EmbeddedResource.new(document) end end |