Class: Kippt::List
Instance Method Summary
collapse
Methods included from Resource
#destroy, included, #initialize, #save, #writable_attributes_hash
Instance Method Details
#clips ⇒ Object
24
25
26
|
# File 'lib/kippt/list.rb', line 24
def clips
Kippt::Clips.new(client, "lists/#{id}/clips")
end
|
#collaborators ⇒ Object
18
19
20
21
22
|
# File 'lib/kippt/list.rb', line 18
def collaborators
attributes.collaborators["data"].map {|collborator_data|
Kippt::User.new(collborator_data, client)
}
end
|
#collection_resource_class ⇒ Object
14
15
16
|
# File 'lib/kippt/list.rb', line 14
def collection_resource_class
Kippt::Lists
end
|
#follow ⇒ Object
34
35
36
37
38
|
# File 'lib/kippt/list.rb', line 34
def follow
response = client.post("#{resource_uri}relationship", :data => {:action => "follow"})
raise Kippt::APIError.new("There was an error with the request: #{response.body["message"]}") unless response.success?
response.success?
end
|
#following? ⇒ Boolean
28
29
30
31
32
|
# File 'lib/kippt/list.rb', line 28
def following?
response = client.get("#{resource_uri}relationship")
raise Kippt::APIError.new("There was an error with the request: #{response.body["message"]}") unless response.success?
response.body["following"]
end
|
#unfollow ⇒ Object
40
41
42
43
44
|
# File 'lib/kippt/list.rb', line 40
def unfollow
response = client.post("#{resource_uri}relationship", :data => {:action => "unfollow"})
raise Kippt::APIError.new("There was an error with the request: #{response.body["message"]}") unless response.success?
response.success?
end
|