Class: Esse::DocumentLazyAttribute

Inherits:
Object
  • Object
show all
Defined in:
lib/esse/document_lazy_attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ DocumentLazyAttribute

Returns a new instance of DocumentLazyAttribute.



7
8
9
# File 'lib/esse/document_lazy_attribute.rb', line 7

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/esse/document_lazy_attribute.rb', line 5

def options
  @options
end

Instance Method Details

#call(doc_headers) ⇒ Hash

Returns an Hash with the document ID as key and attribute data as value.

Parameters:

Returns:

  • (Hash)

    An Hash with the instance of document header as key and the attribute data as value.

Raises:

  • (NotImplementedError)


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

def call(doc_headers)
  raise NotImplementedError, 'Override this method to return the document attribute data'
end