Class: Rawscsi::IndexHelpers::Connection
- Inherits:
-
Object
- Object
- Rawscsi::IndexHelpers::Connection
- Defined in:
- lib/rawscsi/index_helpers/connection.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(config) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(config) ⇒ Connection
Returns a new instance of Connection.
9 10 11 |
# File 'lib/rawscsi/index_helpers/connection.rb', line 9 def initialize(config) @url = config.index_domain || "http://doc-#{config.domain_name}-#{config.domain_id}.#{config.region}.cloudsearch.amazonaws.com" end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/rawscsi/index_helpers/connection.rb', line 7 def url @url end |
Instance Method Details
#build ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/rawscsi/index_helpers/connection.rb', line 13 def build connection = Faraday.new url do |builder| builder.use FaradayMiddleware::EncodeJson builder.adapter Faraday.default_adapter end connection end |