Method: Chewy::Index::Adapter::Object#initialize

Defined in:
lib/chewy/index/adapter/object.rb

#initialize(target, **options) ⇒ Object

The signature of the index scope definition.

Examples:

index_scope :geoname
index_scope Geoname
index_scope -> { Geoname.all_the_places }, name: 'geoname'

Parameters:

  • target (Class, Symbol, String, Proc)

    a source of data and everything

  • options (Hash)

    a customizable set of options

Options Hash (**options):

  • :name (String, Symbol)

    redefines the inferred name if necessary

  • :import_all_method (String, Symbol)

    redefines import method name

  • :load_all_method (String, Symbol)

    redefines batch load method name

  • :load_one_method (String, Symbol)

    redefines per-object load method name



29
30
31
32
# File 'lib/chewy/index/adapter/object.rb', line 29

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