Class: Kippt::Likes
- Inherits:
-
Object
- Object
- Kippt::Likes
- Includes:
- CollectionResource
- Defined in:
- lib/kippt/likes.rb
Overview
This class is only meant to be used by Kippt::Like class for liking and unliking clips.
Instance Attribute Summary collapse
-
#clip ⇒ Object
readonly
Returns the value of attribute clip.
Instance Method Summary collapse
- #base_uri ⇒ Object
- #destroy_resource(resource) ⇒ Object
-
#initialize(client, clip) ⇒ Likes
constructor
A new instance of Likes.
Methods included from CollectionResource
#build, #create, #save_resource
Methods included from ReadCollectionResource
Constructor Details
#initialize(client, clip) ⇒ Likes
Returns a new instance of Likes.
8 9 10 11 |
# File 'lib/kippt/likes.rb', line 8 def initialize(client, clip) @client = client @clip = clip end |
Instance Attribute Details
#clip ⇒ Object (readonly)
Returns the value of attribute clip.
6 7 8 |
# File 'lib/kippt/likes.rb', line 6 def clip @clip end |
Instance Method Details
#base_uri ⇒ Object
13 14 15 |
# File 'lib/kippt/likes.rb', line 13 def base_uri "clips/#{clip.id}/likes" end |
#destroy_resource(resource) ⇒ Object
17 18 19 |
# File 'lib/kippt/likes.rb', line 17 def destroy_resource(resource) client.delete(base_uri).success? end |