Class: Kippt::RootClips
Overview
The root “/clips” resource that exposes features like feed, favorites and search.
Constant Summary collapse
- VALID_SEARCH_PARAMETERS =
[:q, :list, :is_starred]
Instance Attribute Summary
Attributes inherited from Clips
Instance Method Summary collapse
- #favorites ⇒ Object
- #feed ⇒ Object
-
#initialize(client) ⇒ RootClips
constructor
A new instance of RootClips.
- #search(parameters) ⇒ Object
Methods inherited from Clips
#collection_class, #object_class, valid_filter_parameters
Methods included from CollectionResource
#build, #create, #destroy_resource, #save_resource
Methods included from ReadCollectionResource
Constructor Details
#initialize(client) ⇒ RootClips
Returns a new instance of RootClips.
8 9 10 |
# File 'lib/kippt/root_clips.rb', line 8 def initialize(client) super(client, "clips") end |
Instance Method Details
#favorites ⇒ Object
16 17 18 |
# File 'lib/kippt/root_clips.rb', line 16 def favorites Kippt::Clips.new(client, "clips/favorites") end |
#feed ⇒ Object
12 13 14 |
# File 'lib/kippt/root_clips.rb', line 12 def feed Kippt::Clips.new(client, "clips/feed") end |
#search(parameters) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/kippt/root_clips.rb', line 20 def search(parameters) if parameters.is_a?(String) search({:q => parameters}) else validate_search_parameters(parameters) Kippt::ClipCollection.new( client.get("search/clips", parameters).body, client) end end |