Class: DwollaV2::SetUserAgent

Inherits:
Object
  • Object
show all
Defined in:
lib/dwolla_v2/middleware/set_user_agent.rb

Constant Summary collapse

HEADERS =
{
  :"user-agent" => "dwolla-v2-ruby #{VERSION}"
}

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ SetUserAgent

Returns a new instance of SetUserAgent.



7
8
9
# File 'lib/dwolla_v2/middleware/set_user_agent.rb', line 7

def initialize app
  @app = app
end

Instance Method Details

#call(request_env) ⇒ Object



11
12
13
14
# File 'lib/dwolla_v2/middleware/set_user_agent.rb', line 11

def call request_env
  request_env[:request_headers].merge! HEADERS
  @app.call(request_env)
end