Class: Elastic::Configuration
- Inherits:
-
Object
- Object
- Elastic::Configuration
- Includes:
- Railties::ConfigurationExtensions
- Defined in:
- lib/elastic/railtie.rb,
lib/elastic/configuration.rb
Overview
Add activerecord related configuration parameters
Constant Summary collapse
- DEFAULTS =
{ host: '127.0.0.1', port: 9200, page_size: 20, coord_similarity: true, import_batch_size: 10_000, whiny_indices: false, api_client: nil, # set by method logger: nil, # set by method time_zone: nil, # set by method disable_indexing: false, disable_index_name_caching: false }
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
-
#coord_similarity ⇒ Object
Returns the value of attribute coord_similarity.
-
#disable_index_name_caching ⇒ Object
Returns the value of attribute disable_index_name_caching.
-
#disable_indexing ⇒ Object
Returns the value of attribute disable_indexing.
-
#host ⇒ Object
Returns the value of attribute host.
-
#import_batch_size ⇒ Object
Returns the value of attribute import_batch_size.
-
#index ⇒ Object
Returns the value of attribute index.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#page_size ⇒ Object
Returns the value of attribute page_size.
-
#port ⇒ Object
Returns the value of attribute port.
-
#time_zone ⇒ Object
Returns the value of attribute time_zone.
-
#whiny_indices ⇒ Object
Returns the value of attribute whiny_indices.
Attributes included from Railties::ConfigurationExtensions
#active_job_queue, #indices_path
Instance Method Summary collapse
- #assign_attributes(_options) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset ⇒ Object
Methods included from Railties::ConfigurationExtensions
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
20 21 22 |
# File 'lib/elastic/configuration.rb', line 20 def initialize assign_attributes DEFAULTS end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/elastic/configuration.rb', line 17 def api_client @api_client end |
#coord_similarity ⇒ Object
Returns the value of attribute coord_similarity.
17 18 19 |
# File 'lib/elastic/configuration.rb', line 17 def coord_similarity @coord_similarity end |
#disable_index_name_caching ⇒ Object
Returns the value of attribute disable_index_name_caching.
17 18 19 |
# File 'lib/elastic/configuration.rb', line 17 def disable_index_name_caching @disable_index_name_caching end |
#disable_indexing ⇒ Object
Returns the value of attribute disable_indexing.
17 18 19 |
# File 'lib/elastic/configuration.rb', line 17 def disable_indexing @disable_indexing end |
#host ⇒ Object
Returns the value of attribute host.
17 18 19 |
# File 'lib/elastic/configuration.rb', line 17 def host @host end |
#import_batch_size ⇒ Object
Returns the value of attribute import_batch_size.
17 18 19 |
# File 'lib/elastic/configuration.rb', line 17 def import_batch_size @import_batch_size end |
#index ⇒ Object
Returns the value of attribute index.
17 18 19 |
# File 'lib/elastic/configuration.rb', line 17 def index @index end |
#logger ⇒ Object
Returns the value of attribute logger.
17 18 19 |
# File 'lib/elastic/configuration.rb', line 17 def logger @logger end |
#page_size ⇒ Object
Returns the value of attribute page_size.
17 18 19 |
# File 'lib/elastic/configuration.rb', line 17 def page_size @page_size end |
#port ⇒ Object
Returns the value of attribute port.
17 18 19 |
# File 'lib/elastic/configuration.rb', line 17 def port @port end |
#time_zone ⇒ Object
Returns the value of attribute time_zone.
17 18 19 |
# File 'lib/elastic/configuration.rb', line 17 def time_zone @time_zone end |
#whiny_indices ⇒ Object
Returns the value of attribute whiny_indices.
17 18 19 |
# File 'lib/elastic/configuration.rb', line 17 def whiny_indices @whiny_indices end |
Instance Method Details
#assign_attributes(_options) ⇒ Object
28 29 30 31 |
# File 'lib/elastic/configuration.rb', line 28 def assign_attributes() .each { |k, v| public_send("#{k}=", v) } self end |
#reset ⇒ Object
24 25 26 |
# File 'lib/elastic/configuration.rb', line 24 def reset assign_attributes DEFAULTS end |