Method: Chewy::Index::Adapter::Object#name

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

#nameString

Inferred from the target by default if possible.

Examples:

# defines name = Geoname
index_scope :geoname
# still defines name = Geoname
index_scope -> { Geoname.all_the_places }, name: 'geoname'

Returns:

  • (String)


43
44
45
# File 'lib/chewy/index/adapter/object.rb', line 43

def name
  @name ||= (options[:name] || @target).to_s.camelize.demodulize
end