Class: Twitter::Login::Request
- Inherits:
-
Rack::Request
- Object
- Rack::Request
- Twitter::Login::Request
- Defined in:
- lib/twitter/login.rb
Instance Method Summary collapse
-
#session ⇒ Object
for storing :request_token, :access_token.
-
#url_for(path) ⇒ Object
SUCKS: must duplicate logic from the ‘url` method.
- #wants?(mime_type) ⇒ Boolean
Instance Method Details
#session ⇒ Object
for storing :request_token, :access_token
74 75 76 |
# File 'lib/twitter/login.rb', line 74 def session env['rack.session'] ||= {} end |
#url_for(path) ⇒ Object
SUCKS: must duplicate logic from the ‘url` method
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/twitter/login.rb', line 79 def url_for(path) url = scheme + '://' + host if scheme == 'https' && port != 443 || scheme == 'http' && port != 80 url << ":#{port}" end url << path end |
#wants?(mime_type) ⇒ Boolean
90 91 92 |
# File 'lib/twitter/login.rb', line 90 def wants?(mime_type) env['HTTP_ACCEPT'].to_s.include? mime_type end |