Module: Croudia::API::Favorites
- Included in:
- Client
- Defined in:
- lib/croudia/api/favorites.rb
Instance Method Summary collapse
-
#favorite(status_id, params = {}) ⇒ Croudia::Status
Favorite a status.
-
#favorites(params = {}) ⇒ Array<Croudia::Status>
List of favorited statuses.
-
#unfavorite(status_id, params = {}) ⇒ Croudia::Status
Unfavorite a status.
Instance Method Details
#favorite(status_id, params = {}) ⇒ Croudia::Status
Favorite a status
27 28 29 30 31 |
# File 'lib/croudia/api/favorites.rb', line 27 def favorite(status_id, params={}) status_id = get_id(status_id) resp = post("/favorites/create/#{status_id}.json", params) Croudia::Status.new(resp) end |
#favorites(params = {}) ⇒ Array<Croudia::Status>
List of favorited statuses
15 16 17 18 |
# File 'lib/croudia/api/favorites.rb', line 15 def favorites(params={}) resp = get('/favorites.json', params) objects(Croudia::Status, resp) end |
#unfavorite(status_id, params = {}) ⇒ Croudia::Status
Unfavorite a status
40 41 42 43 44 |
# File 'lib/croudia/api/favorites.rb', line 40 def unfavorite(status_id, params={}) status_id = get_id(status_id) resp = delete("/favorites/destroy/#{status_id}.json", params) Croudia::Status.new(resp) end |