Module: AlgoliaSearch::Configuration

Included in:
AlgoliaSearch
Defined in:
lib/algoliasearch/configuration.rb

Instance Method Summary collapse

Instance Method Details

#configurationObject


3
4
5
# File 'lib/algoliasearch/configuration.rb', line 3

def configuration
  @@configuration || raise(NotConfigured, "Please configure AlgoliaSearch. Set AlgoliaSearch.configuration = {application_id: 'YOUR_APPLICATION_ID', api_key: 'YOUR_API_KEY'}")
end

#configuration=(configuration) ⇒ Object


7
8
9
10
# File 'lib/algoliasearch/configuration.rb', line 7

def configuration=(configuration)
  @@configuration = configuration.merge(:user_agent => "Algolia for Rails (#{AlgoliaSearch::VERSION}); Algolia for Ruby (#{Algolia::VERSION})")
  Algolia.init @@configuration
end