Class: Leadlight::ConnectionBuilder
- Inherits:
-
Object
- Object
- Leadlight::ConnectionBuilder
- Extended by:
- Forwardable
- Defined in:
- lib/leadlight/connection_builder.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize {|_self| ... } ⇒ ConnectionBuilder
constructor
A new instance of ConnectionBuilder.
Constructor Details
#initialize {|_self| ... } ⇒ ConnectionBuilder
Returns a new instance of ConnectionBuilder.
15 16 17 |
# File 'lib/leadlight/connection_builder.rb', line 15 def initialize yield self if block_given? end |
Instance Method Details
#call ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/leadlight/connection_builder.rb', line 19 def call Faraday.new(url: url.to_s) do |connection| connection.use Leadlight::ServiceMiddleware, service: service connection.use Faraday::Response::Logger, logger service.instance_exec(connection, &connection_stack) service.instance_exec(connection, &common_stack) connection.adapter = adapter end end |