Class: FireeagleToken
- Inherits:
-
ConsumerToken
- Object
- ActiveRecord::Base
- ConsumerToken
- FireeagleToken
- Defined in:
- lib/oauth/models/consumers/services/fireeagle_token.rb
Overview
Constant Summary collapse
- FIREEAGLE_SETTINGS =
{ :site=>"https://fireeagle.yahooapis.com", :authorize_url=>"https://fireeagle.yahoo.net/oauth/authorize"}
Class Method Summary collapse
Instance Method Summary collapse
- #client ⇒ Object
-
#fireeagle_user ⇒ Object
Returns the FireEagle User object fireeagle.rubyforge.org/classes/FireEagle/User.html.
-
#location ⇒ Object
gives you the best guess of a location for user.
-
#update_location(location = {}) ⇒ Object
Updates thes users location see: fireeagle.rubyforge.org/classes/FireEagle/Client.html#M000026.
Methods inherited from ConsumerToken
find_or_create_from_access_token
Methods included from Oauth::Models::Consumers::Token
Class Method Details
.consumer ⇒ Object
9 10 11 |
# File 'lib/oauth/models/consumers/services/fireeagle_token.rb', line 9 def self.consumer @consumer||=OAuth::Consumer.new credentials[:key],credentials[:secret],FIREEAGLE_SETTINGS end |
Instance Method Details
#client ⇒ Object
13 14 15 16 17 18 |
# File 'lib/oauth/models/consumers/services/fireeagle_token.rb', line 13 def client @client||=FireEagle::Client.new :consumer_key => FireeagleToken.consumer.key, :consumer_secret => FireeagleToken.consumer.secret, :access_token => token, :access_token_secret => secret end |
#fireeagle_user ⇒ Object
Returns the FireEagle User object fireeagle.rubyforge.org/classes/FireEagle/User.html
22 23 24 |
# File 'lib/oauth/models/consumers/services/fireeagle_token.rb', line 22 def fireeagle_user @fireeagle_user||=client.user end |
#location ⇒ Object
gives you the best guess of a location for user. This returns the FireEagle Location object: fireeagle.rubyforge.org/classes/FireEagle/Location.html
29 30 31 |
# File 'lib/oauth/models/consumers/services/fireeagle_token.rb', line 29 def location fireeagle_user.best_guess.name end |
#update_location(location = {}) ⇒ Object
Updates thes users location see: fireeagle.rubyforge.org/classes/FireEagle/Client.html#M000026
35 36 37 |
# File 'lib/oauth/models/consumers/services/fireeagle_token.rb', line 35 def update_location(location={}) client.update(location) end |