Class: Buffer::Api::Update
- Inherits:
-
Object
- Object
- Buffer::Api::Update
- Defined in:
- lib/buffer/api/update.rb
Overview
Returns a social media update api instance.
id - Identifier of a social media update
Instance Method Summary collapse
-
#destroy(options = {}) ⇒ Object
Permanently delete an existing status update.
-
#initialize(id, client) ⇒ Update
constructor
A new instance of Update.
-
#interactions(options = {}) ⇒ Object
Returns the detailed information on individual interactions with the social media update such as favorites, retweets and likes.
-
#share(options = {}) ⇒ Object
Immediately shares a single pending update and recalculates times for updates remaining in the queue.
-
#show(options = {}) ⇒ Object
Returns a single social media update.
-
#top(options = {}) ⇒ Object
Move an existing status update to the top of the queue and recalculate times for all updates in the queue.
-
#update(text, options = {}) ⇒ Object
Edit an existing, individual status update.
Constructor Details
#initialize(id, client) ⇒ Update
Returns a new instance of Update.
10 11 12 13 |
# File 'lib/buffer/api/update.rb', line 10 def initialize(id, client) @id = id @client = client end |
Instance Method Details
#destroy(options = {}) ⇒ Object
Permanently delete an existing status update. ‘/updates/:id/destroy’ POST
64 65 66 67 68 69 70 |
# File 'lib/buffer/api/update.rb', line 64 def destroy( = {}) body = .has_key?(:body) ? [:body] : {} response = @client.post "/updates/#{@id}/destroy", body, return response end |
#interactions(options = {}) ⇒ Object
Returns the detailed information on individual interactions with the social media update such as favorites, retweets and likes. ‘/updates/:id/interactions’ GET
29 30 31 32 33 34 35 |
# File 'lib/buffer/api/update.rb', line 29 def interactions( = {}) body = .has_key?(:query) ? [:query] : {} response = @client.get "/updates/#{@id}/interactions", body, return response end |
#share(options = {}) ⇒ Object
Immediately shares a single pending update and recalculates times for updates remaining in the queue. ‘/updates/:id/share’ POST
53 54 55 56 57 58 59 |
# File 'lib/buffer/api/update.rb', line 53 def share( = {}) body = .has_key?(:body) ? [:body] : {} response = @client.post "/updates/#{@id}/share", body, return response end |
#show(options = {}) ⇒ Object
Returns a single social media update. ‘/updates/:id’ GET
18 19 20 21 22 23 24 |
# File 'lib/buffer/api/update.rb', line 18 def show( = {}) body = .has_key?(:query) ? [:query] : {} response = @client.get "/updates/#{@id}", body, return response end |
#top(options = {}) ⇒ Object
Move an existing status update to the top of the queue and recalculate times for all updates in the queue. Returns the update with its new posting time. ‘/updates/:id/move_to_top’ POST
75 76 77 78 79 80 81 |
# File 'lib/buffer/api/update.rb', line 75 def top( = {}) body = .has_key?(:body) ? [:body] : {} response = @client.post "/updates/#{@id}/move_to_top", body, return response end |
#update(text, options = {}) ⇒ Object
Edit an existing, individual status update. ‘/updates/:id/update’ POST
text - The status update text.
41 42 43 44 45 46 47 48 |
# File 'lib/buffer/api/update.rb', line 41 def update(text, = {}) body = .has_key?(:body) ? [:body] : {} body[:text] = text response = @client.post "/updates/#{@id}/update", body, return response end |