Class: Whatser::User
Instance Attribute Summary collapse
-
#access_token ⇒ Object
writeonly
Sets the attribute access_token.
-
#avatar ⇒ Object
writeonly
Sets the attribute avatar.
-
#avatar_pic ⇒ Object
Returns the value of attribute avatar_pic.
-
#bio ⇒ Object
Returns the value of attribute bio.
-
#check_ins_count ⇒ Object
writeonly
Sets the attribute check_ins_count.
-
#collections_count ⇒ Object
writeonly
Sets the attribute collections_count.
-
#comments_count ⇒ Object
writeonly
Sets the attribute comments_count.
-
#email ⇒ Object
Returns the value of attribute email.
-
#facebook_id ⇒ Object
Returns the value of attribute facebook_id.
-
#followers_count ⇒ Object
writeonly
Sets the attribute followers_count.
-
#follows_count ⇒ Object
writeonly
Sets the attribute follows_count.
-
#foursquare_id ⇒ Object
Returns the value of attribute foursquare_id.
-
#gowalla_id ⇒ Object
Returns the value of attribute gowalla_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_login_at ⇒ Object
Returns the value of attribute last_login_at.
-
#lat ⇒ Object
writeonly
Sets the attribute lat.
-
#lng ⇒ Object
writeonly
Sets the attribute lng.
-
#location ⇒ Object
Returns the value of attribute location.
-
#media_count ⇒ Object
writeonly
Sets the attribute media_count.
-
#name ⇒ Object
Returns the value of attribute name.
-
#password ⇒ Object
writeonly
Sets the attribute password.
-
#poi_count ⇒ Object
writeonly
Sets the attribute poi_count.
-
#promoted ⇒ Object
Returns the value of attribute promoted.
-
#remote_avatar ⇒ Object
writeonly
Sets the attribute remote_avatar.
-
#taggings_count ⇒ Object
writeonly
Sets the attribute taggings_count.
-
#twitter_id ⇒ Object
Returns the value of attribute twitter_id.
-
#twitter_name ⇒ Object
Returns the value of attribute twitter_name.
Attributes inherited from Resource
Class Method Summary collapse
- .anonymous ⇒ Object
- .collectors(id, params = {}) ⇒ Object
- .create(params = {}) ⇒ Object
- .find(id, params = {}) ⇒ Object
- .invite(emails) ⇒ Object
- .me ⇒ Object
- .search(params = {}) ⇒ Object
- .suggested(params = {}) ⇒ Object
- .visitors(id, params = {}) ⇒ Object
Instance Method Summary collapse
- #connection ⇒ Object
- #facebook_connected? ⇒ Boolean
- #followers(params = {}) ⇒ Object
- #foursquare_connected? ⇒ Boolean
- #gowalla_connected? ⇒ Boolean
- #oauth_token ⇒ Object
- #save ⇒ Object
- #thanks(poi_id, params = {}) ⇒ Object
- #to_params ⇒ Object
- #twitter_connected? ⇒ Boolean
Methods inherited from Resource
#api_request, api_request, client, convert_data_to_model, from_hash_to_model, #initialize, set
Constructor Details
This class inherits a constructor from Whatser::Resource
Instance Attribute Details
#access_token=(value) ⇒ Object (writeonly)
Sets the attribute access_token
8 9 10 |
# File 'lib/whatser/resources/user.rb', line 8 def access_token=(value) @access_token = value end |
#avatar=(value) ⇒ Object (writeonly)
Sets the attribute avatar
6 7 8 |
# File 'lib/whatser/resources/user.rb', line 6 def avatar=(value) @avatar = value end |
#avatar_pic ⇒ Object
Returns the value of attribute avatar_pic.
4 5 6 |
# File 'lib/whatser/resources/user.rb', line 4 def avatar_pic @avatar_pic end |
#bio ⇒ Object
Returns the value of attribute bio.
4 5 6 |
# File 'lib/whatser/resources/user.rb', line 4 def bio @bio end |
#check_ins_count=(value) ⇒ Object (writeonly)
Sets the attribute check_ins_count
7 8 9 |
# File 'lib/whatser/resources/user.rb', line 7 def check_ins_count=(value) @check_ins_count = value end |
#collections_count=(value) ⇒ Object (writeonly)
Sets the attribute collections_count
7 8 9 |
# File 'lib/whatser/resources/user.rb', line 7 def collections_count=(value) @collections_count = value end |
#comments_count=(value) ⇒ Object (writeonly)
Sets the attribute comments_count
7 8 9 |
# File 'lib/whatser/resources/user.rb', line 7 def comments_count=(value) @comments_count = value end |
#email ⇒ Object
Returns the value of attribute email.
4 5 6 |
# File 'lib/whatser/resources/user.rb', line 4 def email @email end |
#facebook_id ⇒ Object
Returns the value of attribute facebook_id.
3 4 5 |
# File 'lib/whatser/resources/user.rb', line 3 def facebook_id @facebook_id end |
#followers_count=(value) ⇒ Object (writeonly)
Sets the attribute followers_count
7 8 9 |
# File 'lib/whatser/resources/user.rb', line 7 def followers_count=(value) @followers_count = value end |
#follows_count=(value) ⇒ Object (writeonly)
Sets the attribute follows_count
7 8 9 |
# File 'lib/whatser/resources/user.rb', line 7 def follows_count=(value) @follows_count = value end |
#foursquare_id ⇒ Object
Returns the value of attribute foursquare_id.
3 4 5 |
# File 'lib/whatser/resources/user.rb', line 3 def foursquare_id @foursquare_id end |
#gowalla_id ⇒ Object
Returns the value of attribute gowalla_id.
3 4 5 |
# File 'lib/whatser/resources/user.rb', line 3 def gowalla_id @gowalla_id end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/whatser/resources/user.rb', line 3 def id @id end |
#last_login_at ⇒ Object
Returns the value of attribute last_login_at.
5 6 7 |
# File 'lib/whatser/resources/user.rb', line 5 def last_login_at @last_login_at end |
#lat=(value) ⇒ Object (writeonly)
Sets the attribute lat
6 7 8 |
# File 'lib/whatser/resources/user.rb', line 6 def lat=(value) @lat = value end |
#lng=(value) ⇒ Object (writeonly)
Sets the attribute lng
6 7 8 |
# File 'lib/whatser/resources/user.rb', line 6 def lng=(value) @lng = value end |
#location ⇒ Object
Returns the value of attribute location.
4 5 6 |
# File 'lib/whatser/resources/user.rb', line 4 def location @location end |
#media_count=(value) ⇒ Object (writeonly)
Sets the attribute media_count
7 8 9 |
# File 'lib/whatser/resources/user.rb', line 7 def media_count=(value) @media_count = value end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/whatser/resources/user.rb', line 4 def name @name end |
#password=(value) ⇒ Object (writeonly)
Sets the attribute password
6 7 8 |
# File 'lib/whatser/resources/user.rb', line 6 def password=(value) @password = value end |
#poi_count=(value) ⇒ Object (writeonly)
Sets the attribute poi_count
7 8 9 |
# File 'lib/whatser/resources/user.rb', line 7 def poi_count=(value) @poi_count = value end |
#promoted ⇒ Object
Returns the value of attribute promoted.
5 6 7 |
# File 'lib/whatser/resources/user.rb', line 5 def promoted @promoted end |
#remote_avatar=(value) ⇒ Object (writeonly)
Sets the attribute remote_avatar
6 7 8 |
# File 'lib/whatser/resources/user.rb', line 6 def remote_avatar=(value) @remote_avatar = value end |
#taggings_count=(value) ⇒ Object (writeonly)
Sets the attribute taggings_count
7 8 9 |
# File 'lib/whatser/resources/user.rb', line 7 def taggings_count=(value) @taggings_count = value end |
#twitter_id ⇒ Object
Returns the value of attribute twitter_id.
3 4 5 |
# File 'lib/whatser/resources/user.rb', line 3 def twitter_id @twitter_id end |
#twitter_name ⇒ Object
Returns the value of attribute twitter_name.
4 5 6 |
# File 'lib/whatser/resources/user.rb', line 4 def twitter_name @twitter_name end |
Class Method Details
.anonymous ⇒ Object
15 16 17 |
# File 'lib/whatser/resources/user.rb', line 15 def anonymous api_request :get, "/api/users/anonymous" end |
.collectors(id, params = {}) ⇒ Object
43 44 45 |
# File 'lib/whatser/resources/user.rb', line 43 def collectors(id, params={}) api_request :get, "/api/poi/#{id}/collectors", {:query => params} end |
.create(params = {}) ⇒ Object
31 32 33 |
# File 'lib/whatser/resources/user.rb', line 31 def create(params={}) api_request :post, "/api/users", {:body => {'user' => params} }, :auth => :key end |
.find(id, params = {}) ⇒ Object
27 28 29 |
# File 'lib/whatser/resources/user.rb', line 27 def find(id, params={}) api_request :get, "/api/users/#{id}/profile", {:query => params} end |
.invite(emails) ⇒ Object
35 36 37 |
# File 'lib/whatser/resources/user.rb', line 35 def invite(emails) api_request :post, "/api/invites", {:query => {'emails' => emails} } end |
.me ⇒ Object
11 12 13 |
# File 'lib/whatser/resources/user.rb', line 11 def me api_request :get, "/api/users/me" end |
.search(params = {}) ⇒ Object
19 20 21 |
# File 'lib/whatser/resources/user.rb', line 19 def search(params={}) api_request :get, "/api/users/lookup", {:query => params} end |
.suggested(params = {}) ⇒ Object
23 24 25 |
# File 'lib/whatser/resources/user.rb', line 23 def suggested(params={}) api_request :get, "/api/users/suggested", {:query => params} end |
.visitors(id, params = {}) ⇒ Object
39 40 41 |
# File 'lib/whatser/resources/user.rb', line 39 def visitors(id, params={}) api_request :get, "/api/poi/#{id}/visitors", {:query => params} end |
Instance Method Details
#connection ⇒ Object
56 57 58 |
# File 'lib/whatser/resources/user.rb', line 56 def connection Whatser::Follow.set(self.class.client).connection(id) end |
#facebook_connected? ⇒ Boolean
72 73 74 |
# File 'lib/whatser/resources/user.rb', line 72 def facebook_connected? !facebook_id.blank? end |
#followers(params = {}) ⇒ Object
60 61 62 |
# File 'lib/whatser/resources/user.rb', line 60 def followers(params={}) Whatser::Follow.set(self.class.client).followers(id, params) end |
#foursquare_connected? ⇒ Boolean
76 77 78 |
# File 'lib/whatser/resources/user.rb', line 76 def foursquare_connected? !foursquare_id.blank? end |
#gowalla_connected? ⇒ Boolean
80 81 82 |
# File 'lib/whatser/resources/user.rb', line 80 def gowalla_connected? !gowalla_id.blank? end |
#oauth_token ⇒ Object
68 69 70 |
# File 'lib/whatser/resources/user.rb', line 68 def oauth_token access_token end |
#save ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/whatser/resources/user.rb', line 48 def save if id.blank? api_request :post, "/api/users", {:body => {'user' => to_params} }, :auth => :key else api_request :put, "/api/users/me", {:body => {'user' => to_params} } end end |
#thanks(poi_id, params = {}) ⇒ Object
64 65 66 |
# File 'lib/whatser/resources/user.rb', line 64 def thanks(poi_id,params={}) api_request :post, "/api/users/#{id}/poi/#{poi_id}/thanks", {:query => params} end |
#to_params ⇒ Object
88 89 90 |
# File 'lib/whatser/resources/user.rb', line 88 def to_params {:name=>name,:avatar_pic=>@remote_avatar,:location=>location,:bio=>bio,:email=>email} end |
#twitter_connected? ⇒ Boolean
84 85 86 |
# File 'lib/whatser/resources/user.rb', line 84 def twitter_connected? !twitter_id.blank? end |