Class: Kippt::Clip
Instance Method Summary
collapse
Methods included from Resource
#destroy, included, #initialize, #save, #writable_attributes_hash
Instance Method Details
43
44
45
|
# File 'lib/kippt/clip.rb', line 43
def
== .size
end
|
#all_likes_embedded? ⇒ Boolean
59
60
61
|
# File 'lib/kippt/clip.rb', line 59
def all_likes_embedded?
likes_count == likes_data.size
end
|
#collection_resource_class ⇒ Object
27
28
29
|
# File 'lib/kippt/clip.rb', line 27
def collection_resource_class
Kippt::RootClips
end
|
39
40
41
|
# File 'lib/kippt/clip.rb', line 39
def
Kippt::Comments.new(client, self)
end
|
47
48
49
|
# File 'lib/kippt/clip.rb', line 47
def
attributes.["count"]
end
|
51
52
53
|
# File 'lib/kippt/clip.rb', line 51
def
attributes.["data"]
end
|
#favorite ⇒ Object
91
92
93
|
# File 'lib/kippt/clip.rb', line 91
def favorite
Kippt::Favorite.new(self, client).save
end
|
#like ⇒ Object
83
84
85
|
# File 'lib/kippt/clip.rb', line 83
def like
Kippt::Like.new(self, client).save
end
|
#likes ⇒ Object
55
56
57
|
# File 'lib/kippt/clip.rb', line 55
def likes
Kippt::ClipLikes.new(client, self)
end
|
#likes_count ⇒ Object
63
64
65
|
# File 'lib/kippt/clip.rb', line 63
def likes_count
attributes.likes["count"]
end
|
#likes_data ⇒ Object
67
68
69
|
# File 'lib/kippt/clip.rb', line 67
def likes_data
attributes.likes["data"]
end
|
#list_uri ⇒ Object
31
32
33
34
35
36
37
|
# File 'lib/kippt/clip.rb', line 31
def list_uri
if attributes.list.is_a? String
attributes.list
else
list.resource_uri
end
end
|
#saves ⇒ Object
71
72
73
|
# File 'lib/kippt/clip.rb', line 71
def saves
Kippt::Saves.new(client, self)
end
|
#saves_count ⇒ Object
75
76
77
|
# File 'lib/kippt/clip.rb', line 75
def saves_count
attributes.saves["count"]
end
|
#saves_data ⇒ Object
79
80
81
|
# File 'lib/kippt/clip.rb', line 79
def saves_data
attributes.saves["data"]
end
|
#unlike ⇒ Object
87
88
89
|
# File 'lib/kippt/clip.rb', line 87
def unlike
Kippt::Like.new(self, client).destroy
end
|