Module: Twitter::Client::SavedSearches
- Included in:
- Twitter::Client
- Defined in:
- lib/twitter/client/saved_searches.rb
Overview
Defines methods related to saved searches
Instance Method Summary collapse
-
#saved_search(id, options = {}) ⇒ Twitter::SavedSearch
Retrieve the data for a saved search owned by the authenticating user specified by the given ID.
-
#saved_search_create(query, options = {}) ⇒ Twitter::SavedSearch
Creates a saved search for the authenticated user.
-
#saved_search_destroy(id, options = {}) ⇒ Twitter::SavedSearch
Destroys a saved search for the authenticated user.
-
#saved_searches(options = {}) ⇒ Array<Twitter::SavedSearch>
Returns the authenticated user's saved search queries.
Instance Method Details
#saved_search(id, options = {}) ⇒ Twitter::SavedSearch
Retrieve the data for a saved search owned by the authenticating user specified by the given ID
35 36 37 38 |
# File 'lib/twitter/client/saved_searches.rb', line 35 def saved_search(id, ={}) saved_search = get("/1/saved_searches/show/#{id}.json", ) Twitter::SavedSearch.new(saved_search) end |
#saved_search_create(query, options = {}) ⇒ Twitter::SavedSearch
Creates a saved search for the authenticated user
50 51 52 53 |
# File 'lib/twitter/client/saved_searches.rb', line 50 def saved_search_create(query, ={}) saved_search = post("/1/saved_searches/create.json", .merge(:query => query)) Twitter::SavedSearch.new(saved_search) end |
#saved_search_destroy(id, options = {}) ⇒ Twitter::SavedSearch
Note:
The search specified by ID must be owned by the authenticating user.
Destroys a saved search for the authenticated user
66 67 68 69 |
# File 'lib/twitter/client/saved_searches.rb', line 66 def saved_search_destroy(id, ={}) saved_search = delete("/1/saved_searches/destroy/#{id}.json", ) Twitter::SavedSearch.new(saved_search) end |
#saved_searches(options = {}) ⇒ Array<Twitter::SavedSearch>
Returns the authenticated user's saved search queries
18 19 20 21 22 |
# File 'lib/twitter/client/saved_searches.rb', line 18 def saved_searches(={}) get("/1/saved_searches.json", ).map do |saved_search| Twitter::SavedSearch.new(saved_search) end end |