Class: Cetacean::EmbeddedResourceCollection

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/cetacean/embedded_resource_collection.rb

Instance Method Summary collapse

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

#eachObject



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