Class: Tumblr::Params

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/tumblr/middleware/params.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



3
4
5
6
7
8
# File 'lib/tumblr/middleware/params.rb', line 3

def call(env)
  params = env[:url].query_values || {}
  env[:url].query_values ||= {}
  env[:url].query_values = { 'api_key' => Tumblr.config.api_key }.merge!(params)
  @app.call env
end