Class: Kippt::Favorites
- Inherits:
-
Object
- Object
- Kippt::Favorites
- Includes:
- CollectionResource
- Defined in:
- lib/kippt/favorites.rb
Overview
This class is only meant to be used by Kippt::Favorite class for favoriting and unfavoriting 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) ⇒ Favorites
constructor
A new instance of Favorites.
Methods included from CollectionResource
#build, #create, #save_resource
Methods included from ReadCollectionResource
Constructor Details
#initialize(client, clip) ⇒ Favorites
Returns a new instance of Favorites.
8 9 10 11 |
# File 'lib/kippt/favorites.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/favorites.rb', line 6 def clip @clip end |
Instance Method Details
#base_uri ⇒ Object
13 14 15 |
# File 'lib/kippt/favorites.rb', line 13 def base_uri "clips/#{clip.id}/favorites" end |
#destroy_resource(resource) ⇒ Object
17 18 19 |
# File 'lib/kippt/favorites.rb', line 17 def destroy_resource(resource) client.delete(base_uri).success? end |