Class: Whatser::Follow

Inherits:
Resource show all
Defined in:
lib/whatser/resources/follow.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#json

Class Method Summary collapse

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_picObject

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_countObject

Returns the value of attribute collections_count.



5
6
7
# File 'lib/whatser/resources/follow.rb', line 5

def collections_count
  @collections_count
end

#foafObject

Returns the value of attribute foaf.



6
7
8
# File 'lib/whatser/resources/follow.rb', line 6

def foaf
  @foaf
end

#foaf_countObject

Returns the value of attribute foaf_count.



6
7
8
# File 'lib/whatser/resources/follow.rb', line 6

def foaf_count
  @foaf_count
end

#followedObject

Returns the value of attribute followed.



6
7
8
# File 'lib/whatser/resources/follow.rb', line 6

def followed
  @followed
end

#followingObject

Returns the value of attribute following.



6
7
8
# File 'lib/whatser/resources/follow.rb', line 6

def following
  @following
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/whatser/resources/follow.rb', line 3

def id
  @id
end

#locationObject

Returns the value of attribute location.



4
5
6
# File 'lib/whatser/resources/follow.rb', line 4

def location
  @location
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/whatser/resources/follow.rb', line 4

def name
  @name
end

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

#deleteObject



42
43
44
# File 'lib/whatser/resources/follow.rb', line 42

def delete
  self.class.ignore( id )
end

#saveObject



38
39
40
# File 'lib/whatser/resources/follow.rb', line 38

def save
  self.class.create( id )
end