Class: ShippingEasy::Http::FaradayAdapter::CustomUserAgent
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- ShippingEasy::Http::FaradayAdapter::CustomUserAgent
- Defined in:
- lib/shipping_easy/http/faraday_adapter.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, agent_string) ⇒ CustomUserAgent
constructor
A new instance of CustomUserAgent.
Constructor Details
#initialize(app, agent_string) ⇒ CustomUserAgent
Returns a new instance of CustomUserAgent.
41 42 43 44 |
# File 'lib/shipping_easy/http/faraday_adapter.rb', line 41 def initialize(app, agent_string) super(app) @agent_string = agent_string end |
Instance Method Details
#call(env) ⇒ Object
46 47 48 49 |
# File 'lib/shipping_easy/http/faraday_adapter.rb', line 46 def call(env) env[:request_headers]['User-Agent'] = @agent_string @app.call(env) end |