Class: Elasticity::Search::DocumentProxy

Inherits:
BasicObject
Defined in:
lib/elasticity/search.rb

Instance Method Summary collapse

Constructor Details

#initialize(search, document_klass) ⇒ DocumentProxy


245
246
247
248
# File 'lib/elasticity/search.rb', line 245

def initialize(search, document_klass)
  @search         = search
  @document_klass = document_klass
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object


260
261
262
# File 'lib/elasticity/search.rb', line 260

def method_missing(method_name, *args, &block)
  documents.public_send(method_name, *args, &block)
end

Instance Method Details

#documentsObject


252
253
254
# File 'lib/elasticity/search.rb', line 252

def documents
  @search.documents(@document_klass)
end

#scan_documents(**options) ⇒ Object


256
257
258
# File 'lib/elasticity/search.rb', line 256

def scan_documents(**options)
  @search.scan_documents(@document_klass, **options)
end