Class: Twitter::Login::Request

Inherits:
Rack::Request
  • Object
show all
Defined in:
lib/twitter/login.rb

Instance Method Summary collapse

Instance Method Details

#sessionObject

for storing :request_token, :access_token



69
70
71
# File 'lib/twitter/login.rb', line 69

def session
  env['rack.session'] ||= {}
end

#url_for(path) ⇒ Object

SUCKS: must duplicate logic from the ‘url` method



74
75
76
77
78
79
80
81
82
83
# File 'lib/twitter/login.rb', line 74

def url_for(path)
  url = scheme + '://' + host

  if scheme == 'https' && port != 443 ||
      scheme == 'http' && port != 80
    url << ":#{port}"
  end

  url << path
end