Class: Swrve::Middleware::Http
- Inherits:
-
Object
- Object
- Swrve::Middleware::Http
- Extended by:
- Forwardable
- Defined in:
- lib/swrve/middleware/http.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(endpoint) ⇒ Http
constructor
A new instance of Http.
Constructor Details
#initialize(endpoint) ⇒ Http
Returns a new instance of Http.
14 15 16 17 18 19 20 |
# File 'lib/swrve/middleware/http.rb', line 14 def initialize(endpoint) @client = Faraday.new(endpoint) do |faraday| faraday.request :url_encoded faraday.adapter Swrve.config.http_adapter faraday.use FaradayMiddleware::ParseJson end end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
10 11 12 |
# File 'lib/swrve/middleware/http.rb', line 10 def client @client end |