Class: Whatser::Client
Constant Summary
Whatser::Configuration::DEFAULT_API_URI, Whatser::Configuration::VALID_OPTIONS_KEYS
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from OAuth
#get_oauth_token, #login, #oauth_authorize_url, #oauth_client
Methods included from Http
included, #request
included
Constructor Details
#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(options={})
Whatser::Configuration::VALID_OPTIONS_KEYS.each do |key|
if options[key].blank?
send("#{key}=", self.class.send(key) )
else
send("#{key}=", options[key])
end
end
end
|
Instance Attribute Details
#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
10
11
12
13
|
# File 'lib/whatser/client.rb', line 10
def configure
yield self
true
end
|
Instance Method Details
#authorized? ⇒ Boolean
50
51
52
|
# File 'lib/whatser/client.rb', line 50
def authorized?
!oauth_token.blank?
end
|
#check_ins ⇒ Object
28
|
# File 'lib/whatser/client.rb', line 28
def check_ins; Whatser::CheckIn.set(self); end
|
#cities ⇒ Object
38
|
# File 'lib/whatser/client.rb', line 38
def cities; Whatser::City.set(self); end
|
#data_sources ⇒ Object
30
|
# File 'lib/whatser/client.rb', line 30
def data_sources; Whatser::DataSource.set(self); end
|
#follows ⇒ Object
34
|
# File 'lib/whatser/client.rb', line 34
def follows; Whatser::Follow.set(self); end
|
#gowalla ⇒ Object
43
|
# File 'lib/whatser/client.rb', line 43
def gowalla; Whatser::Gowalla.set(self); end
|
#log(msg, level = :info) ⇒ Object
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
|
31
|
# File 'lib/whatser/client.rb', line 31
def media; Whatser::Media.set(self); end
|
#spots ⇒ Object
32
|
# File 'lib/whatser/client.rb', line 32
def spots; Whatser::Poi.set(self); end
|
36
|
# File 'lib/whatser/client.rb', line 36
def tags; Whatser::Tag.set(self); end
|
#users ⇒ Object
33
|
# File 'lib/whatser/client.rb', line 33
def users; Whatser::User.set(self); end
|