Class: Whatser::Client
- Inherits:
-
Object
- Object
- Whatser::Client
- Includes:
- Configuration, Http, OAuth
- Defined in:
- lib/whatser/client.rb
Constant Summary
Constants included from Configuration
Whatser::Configuration::DEFAULT_API_URI, Whatser::Configuration::VALID_OPTIONS_KEYS
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Class Method Summary collapse
Instance Method Summary collapse
- #authorized? ⇒ Boolean
- #check_ins ⇒ Object
- #cities ⇒ Object
- #collections ⇒ Object
- #comments ⇒ Object
- #data_sources ⇒ Object
- #facebook ⇒ Object
- #feeds ⇒ Object
- #follows ⇒ Object
- #foursquare ⇒ Object
- #gowalla ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #log(msg, level = :info) ⇒ Object
- #media ⇒ Object
- #spots ⇒ Object
- #subscriptions ⇒ Object
- #tags ⇒ Object
- #twitter ⇒ Object
- #users ⇒ Object
Methods included from OAuth
#get_oauth_token, #login, #oauth_authorize_url, #oauth_client
Methods included from Http
Methods included from Configuration
Constructor Details
permalink #initialize(options = {}) ⇒ Client
Returns a new instance of Client.
18 19 20 21 22 23 24 25 26 |
# File 'lib/whatser/client.rb', line 18 def initialize(={}) Whatser::Configuration::VALID_OPTIONS_KEYS.each do |key| if [key].blank? send("#{key}=", self.class.send(key) ) else send("#{key}=", [key]) end end end |
Instance Attribute Details
permalink #logger ⇒ Object
Returns the value of attribute logger.
16 17 18 |
# File 'lib/whatser/client.rb', line 16 def logger @logger end |
Class Method Details
permalink .configure {|_self| ... } ⇒ Object
10 11 12 13 |
# File 'lib/whatser/client.rb', line 10 def configure yield self true end |
Instance Method Details
permalink #authorized? ⇒ Boolean
50 51 52 |
# File 'lib/whatser/client.rb', line 50 def !oauth_token.blank? end |
permalink #check_ins ⇒ Object
[View source]
28 |
# File 'lib/whatser/client.rb', line 28 def check_ins; Whatser::CheckIn.set(self); end |
permalink #cities ⇒ Object
[View source]
38 |
# File 'lib/whatser/client.rb', line 38 def cities; Whatser::City.set(self); end |
permalink #collections ⇒ Object
[View source]
29 |
# File 'lib/whatser/client.rb', line 29 def collections; Whatser::Collection.set(self); end |
permalink #comments ⇒ Object
[View source]
37 |
# File 'lib/whatser/client.rb', line 37 def comments; Whatser::Comment.set(self); end |
permalink #data_sources ⇒ Object
[View source]
30 |
# File 'lib/whatser/client.rb', line 30 def data_sources; Whatser::DataSource.set(self); end |
permalink #facebook ⇒ Object
[View source]
41 |
# File 'lib/whatser/client.rb', line 41 def facebook; Whatser::Facebook.set(self); end |
permalink #feeds ⇒ Object
[View source]
39 |
# File 'lib/whatser/client.rb', line 39 def feeds; Whatser::ActivityFeed.set(self); end |
permalink #follows ⇒ Object
[View source]
34 |
# File 'lib/whatser/client.rb', line 34 def follows; Whatser::Follow.set(self); end |
permalink #foursquare ⇒ Object
[View source]
42 |
# File 'lib/whatser/client.rb', line 42 def foursquare; Whatser::Foursquare.set(self); end |
permalink #gowalla ⇒ Object
[View source]
43 |
# File 'lib/whatser/client.rb', line 43 def gowalla; Whatser::Gowalla.set(self); end |
permalink #log(msg, level = :info) ⇒ Object
[View source]
54 55 56 57 |
# File 'lib/whatser/client.rb', line 54 def log(msg,level=:info) return if logger.blank? logger.send(level, msg) end |
permalink #media ⇒ Object
[View source]
31 |
# File 'lib/whatser/client.rb', line 31 def media; Whatser::Media.set(self); end |
permalink #spots ⇒ Object
[View source]
32 |
# File 'lib/whatser/client.rb', line 32 def spots; Whatser::Poi.set(self); end |
permalink #subscriptions ⇒ Object
[View source]
35 |
# File 'lib/whatser/client.rb', line 35 def subscriptions; Whatser::Subscription.set(self); end |
permalink #tags ⇒ Object
[View source]
36 |
# File 'lib/whatser/client.rb', line 36 def ; Whatser::Tag.set(self); end |
permalink #twitter ⇒ Object
[View source]
44 |
# File 'lib/whatser/client.rb', line 44 def twitter; Whatser::Twitter.set(self); end |
permalink #users ⇒ Object
[View source]
33 |
# File 'lib/whatser/client.rb', line 33 def users; Whatser::User.set(self); end |