Class: Twitter::Request::Phoenix

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/twitter/request/phoenix.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Phoenix

Returns a new instance of Phoenix.



16
17
18
# File 'lib/twitter/request/phoenix.rb', line 16

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/twitter/request/phoenix.rb', line 7

def call(env)
  # Not sure what what the X-Phx (Phoenix?) header is for but it's
  # required to access certain undocumented resources
  # e.g. GET urls/resolve
  env[:request_headers]['X-Phx'] = 'true' if env[:request][:phoenix]

  @app.call(env)
end