Class: Whatser::Follow
- Defined in:
- lib/whatser/resources/follow.rb
Instance Attribute Summary collapse
-
#avatar_pic ⇒ Object
Returns the value of attribute avatar_pic.
-
#collections_count ⇒ Object
Returns the value of attribute collections_count.
-
#foaf ⇒ Object
Returns the value of attribute foaf.
-
#foaf_count ⇒ Object
Returns the value of attribute foaf_count.
-
#followed ⇒ Object
Returns the value of attribute followed.
-
#following ⇒ Object
Returns the value of attribute following.
-
#id ⇒ Object
Returns the value of attribute id.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#promoted ⇒ Object
Returns the value of attribute promoted.
Attributes inherited from Resource
Class Method Summary collapse
- .connection(user_id) ⇒ Object
- .create(user_id, opts = {}) ⇒ Object
- .delete(user_id) ⇒ Object
- .followers(id, opts = {}) ⇒ Object
- .ignore(user_id) ⇒ Object
- .list(opts = {}) ⇒ Object
- .suggested(opts = {}) ⇒ Object
Instance Method Summary collapse
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
#avatar_pic ⇒ Object
Returns the value of attribute avatar_pic.
4 5 6 |
# File 'lib/whatser/resources/follow.rb', line 4 def avatar_pic @avatar_pic end |
#collections_count ⇒ Object
Returns the value of attribute collections_count.
5 6 7 |
# File 'lib/whatser/resources/follow.rb', line 5 def collections_count @collections_count end |
#foaf ⇒ Object
Returns the value of attribute foaf.
6 7 8 |
# File 'lib/whatser/resources/follow.rb', line 6 def foaf @foaf end |
#foaf_count ⇒ Object
Returns the value of attribute foaf_count.
6 7 8 |
# File 'lib/whatser/resources/follow.rb', line 6 def foaf_count @foaf_count end |
#followed ⇒ Object
Returns the value of attribute followed.
6 7 8 |
# File 'lib/whatser/resources/follow.rb', line 6 def followed @followed end |
#following ⇒ Object
Returns the value of attribute following.
6 7 8 |
# File 'lib/whatser/resources/follow.rb', line 6 def following @following end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/whatser/resources/follow.rb', line 3 def id @id end |
#location ⇒ Object
Returns the value of attribute location.
4 5 6 |
# File 'lib/whatser/resources/follow.rb', line 4 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/whatser/resources/follow.rb', line 4 def name @name end |
#promoted ⇒ Object
Returns the value of attribute promoted.
5 6 7 |
# File 'lib/whatser/resources/follow.rb', line 5 def promoted @promoted end |
Class Method Details
.connection(user_id) ⇒ Object
33 34 35 |
# File 'lib/whatser/resources/follow.rb', line 33 def connection(user_id) api_request :get, "/api/users/#{user_id}/connection" end |
.create(user_id, opts = {}) ⇒ Object
21 22 23 |
# File 'lib/whatser/resources/follow.rb', line 21 def create(user_id, opts={}) api_request :post, "/api/follows/#{user_id}", {:query => opts, :body => ''} end |
.delete(user_id) ⇒ Object
25 26 27 |
# File 'lib/whatser/resources/follow.rb', line 25 def delete(user_id) api_request :delete, "/api/follows/#{user_id}" end |
.followers(id, opts = {}) ⇒ Object
13 14 15 |
# File 'lib/whatser/resources/follow.rb', line 13 def followers(id, opts={}) api_request :get, "/api/users/#{id}/followers", {:query => opts} end |
.ignore(user_id) ⇒ Object
29 30 31 |
# File 'lib/whatser/resources/follow.rb', line 29 def ignore(user_id) delete(user_id) end |
.list(opts = {}) ⇒ Object
9 10 11 |
# File 'lib/whatser/resources/follow.rb', line 9 def list(opts={}) api_request :get, "/api/follows", {:query => opts} end |
.suggested(opts = {}) ⇒ Object
17 18 19 |
# File 'lib/whatser/resources/follow.rb', line 17 def suggested(opts={}) api_request :get, "/api/users/suggested", {:query => opts} end |
Instance Method Details
#delete ⇒ Object
42 43 44 |
# File 'lib/whatser/resources/follow.rb', line 42 def delete self.class.ignore( id ) end |
#save ⇒ Object
38 39 40 |
# File 'lib/whatser/resources/follow.rb', line 38 def save self.class.create( id ) end |