Module: Stretchy::Utils::Configuration
- Defined in:
- lib/stretchy/utils/configuration.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#client(options = {}) ⇒ Object
Returns the value of attribute client.
-
#index_name ⇒ Object
Returns the value of attribute index_name.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
5 6 7 |
# File 'lib/stretchy/utils/configuration.rb', line 5 def adapter @adapter end |
#client(options = {}) ⇒ Object
Returns the value of attribute client.
5 6 7 |
# File 'lib/stretchy/utils/configuration.rb', line 5 def client @client end |
#index_name ⇒ Object
Returns the value of attribute index_name.
5 6 7 |
# File 'lib/stretchy/utils/configuration.rb', line 5 def index_name @index_name end |
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/stretchy/utils/configuration.rb', line 5 def logger @logger end |
#url ⇒ Object
Returns the value of attribute url.
5 6 7 |
# File 'lib/stretchy/utils/configuration.rb', line 5 def url @url end |
Class Method Details
.extended(base) ⇒ Object
7 8 9 |
# File 'lib/stretchy/utils/configuration.rb', line 7 def self.extended(base) base.set_default_configuration end |
Instance Method Details
#client_options ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/stretchy/utils/configuration.rb', line 21 def Hash[ index_name: index_name, log: !!logger, logger: logger, adapter: adapter, url: url ] end |
#configure {|_self| ... } ⇒ Object
11 12 13 |
# File 'lib/stretchy/utils/configuration.rb', line 11 def configure yield self end |
#set_default_configuration ⇒ Object
15 16 17 18 19 |
# File 'lib/stretchy/utils/configuration.rb', line 15 def set_default_configuration self.index_name = 'myapp' self.adapter = :excon self.url = ENV['ELASTICSEARCH_URL'] end |