Module: Croudia::API::Statuses
- Included in:
- Client
- Defined in:
- lib/croudia/api/statuses.rb
Instance Method Summary collapse
-
#destroy_status(status, params = {}) ⇒ Croudia::Status
Destroy a status.
-
#share(id, status = {}, params = {}) ⇒ Croudia::Status
Share (formerly reply with quote) a status.
-
#share_with_media(id, status = {}, media = {}, params = {}) ⇒ Croudia::Status
Share (formerly reply with quote) a status with media.
-
#spread(status, params = {}) ⇒ Croudia::Status
Spread a status.
-
#status(status, params = {}) ⇒ Croudia::Status
Retrieve a status.
-
#update(status, params = {}) ⇒ Croudia::Status
Update status.
-
#update_with_media(status, media = {}, params = {}) ⇒ Croudia::Status
Update status with media.
Instance Method Details
#destroy_status(status, params = {}) ⇒ Croudia::Status
Destroy a status
63 64 65 66 67 |
# File 'lib/croudia/api/statuses.rb', line 63 def destroy_status(status, params={}) status_id = get_id(status) resp = post("/statuses/destroy/#{status_id}.json", params) Croudia::Status.new(resp) end |
#share(id, status, params = {}) ⇒ Croudia::Status #share(params = {}) ⇒ Croudia::Status
Share (formerly reply with quote) a status
113 114 115 116 117 118 |
# File 'lib/croudia/api/statuses.rb', line 113 def share(id, status={}, params={}) merge_id!(params, id) merge_text!(params, status) resp = post('/statuses/share.json', params) Croudia::Status.new(resp) end |
#share_with_media(id, status, media, params = {}) ⇒ Croudia::Status #share_with_media(params = {}) ⇒ Croudia::Status
Note:
Currently only PNG, JPG, and GIF are supported
Share (formerly reply with quote) a status with media
139 140 141 142 143 144 145 |
# File 'lib/croudia/api/statuses.rb', line 139 def share_with_media(id, status={}, media={}, params={}) merge_id!(params, id) merge_text!(params, status) merge_file!(params, media, :media) resp = post('/statuses/share_with_media.json', params) Croudia::Status.new(resp) end |
#spread(status, params = {}) ⇒ Croudia::Status
Spread a status
91 92 93 94 95 |
# File 'lib/croudia/api/statuses.rb', line 91 def spread(status, params={}) status_id = get_id(status) resp = post("/statuses/spread/#{status_id}.json", params) Croudia::Status.new(resp) end |
#status(status, params = {}) ⇒ Croudia::Status
Retrieve a status
77 78 79 80 81 |
# File 'lib/croudia/api/statuses.rb', line 77 def status(status, params={}) status_id = get_id(status) resp = get("/statuses/show/#{status_id}.json", params) Croudia::Status.new(resp) end |
#update(status, params = {}) ⇒ Croudia::Status #update(params = {}) ⇒ Croudia::Status
Update status
22 23 24 25 26 27 |
# File 'lib/croudia/api/statuses.rb', line 22 def update(status, params={}) merge_text!(params, status) resp = post('/statuses/update.json', params) Croudia::Status.new(resp) end |
#update_with_media(status, media, params = {}) ⇒ Croudia::Status #update_with_media(params = {}) ⇒ Croudia::Status
Note:
Currently only PNG, JPG, and GIF are supported
Update status with media
48 49 50 51 52 53 |
# File 'lib/croudia/api/statuses.rb', line 48 def update_with_media(status, media={}, params={}) merge_text!(params, status) merge_file!(params, media, :media) resp = post('/statuses/update_with_media.json', params) Croudia::Status.new(resp) end |