Class: Esse::Collection

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/esse/collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Collection

Returns a new instance of Collection.



8
9
10
# File 'lib/esse/collection.rb', line 8

def initialize(**options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/esse/collection.rb', line 6

def options
  @options
end

Instance Method Details

#each {|<Array, Hash>| ... } ⇒ Object

This method is abstract.

Override this method to yield each chunk of documents with optional metadata

Yields:

  • (<Array, Hash>)

    A batch of documents to be serialized and indexed.

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/esse/collection.rb', line 14

def each
  raise NotImplementedError, 'Override this method to iterate over the collection'
end