Class: Buffer::Api::Profile
- Inherits:
-
Object
- Object
- Buffer::Api::Profile
- Defined in:
- lib/buffer/api/profile.rb
Overview
Returns a social media profile api instance.
id - Identifier of a social media profile
Instance Method Summary collapse
-
#initialize(id, client) ⇒ Profile
constructor
A new instance of Profile.
-
#pending(options = {}) ⇒ Object
Returns an array of updates that are currently in the buffer for an individual social media profile.
-
#reorder(order, options = {}) ⇒ Object
Edit the order at which statuses for the specified social media profile will be sent out of the buffer.
-
#sent(options = {}) ⇒ Object
Returns an array of updates that have been sent from the buffer for an individual social media profile.
-
#show(options = {}) ⇒ Object
Returns details of the single specified social media profile.
-
#shuffle(options = {}) ⇒ Object
Randomize the order at which statuses for the specified social media profile will be sent out of the buffer.
Constructor Details
#initialize(id, client) ⇒ Profile
Returns a new instance of Profile.
10 11 12 13 |
# File 'lib/buffer/api/profile.rb', line 10 def initialize(id, client) @id = id @client = client end |
Instance Method Details
#pending(options = {}) ⇒ Object
Returns an array of updates that are currently in the buffer for an individual social media profile. ‘/profiles/:id/updates/pending’ GET
29 30 31 32 33 34 35 |
# File 'lib/buffer/api/profile.rb', line 29 def pending( = {}) body = .has_key?(:query) ? [:query] : {} response = @client.get "/profiles/#{@id}/updates/pending", body, return response end |
#reorder(order, options = {}) ⇒ Object
Edit the order at which statuses for the specified social media profile will be sent out of the buffer. ‘/profiles/:id/updates/reorder’ POST
order - An ordered array of status update id’s. This can be a partial array in combination with the offset parameter or a full array of every update in the profiles Buffer.
52 53 54 55 56 57 58 59 |
# File 'lib/buffer/api/profile.rb', line 52 def reorder(order, = {}) body = .has_key?(:body) ? [:body] : {} body[:order] = order response = @client.post "/profiles/#{@id}/updates/reorder", body, return response end |
#sent(options = {}) ⇒ Object
Returns an array of updates that have been sent from the buffer for an individual social media profile. ‘/profiles/:id/updates/sent’ GET
40 41 42 43 44 45 46 |
# File 'lib/buffer/api/profile.rb', line 40 def sent( = {}) body = .has_key?(:query) ? [:query] : {} response = @client.get "/profiles/#{@id}/updates/sent", body, return response end |
#show(options = {}) ⇒ Object
Returns details of the single specified social media profile. ‘/profiles/:id’ GET
18 19 20 21 22 23 24 |
# File 'lib/buffer/api/profile.rb', line 18 def show( = {}) body = .has_key?(:query) ? [:query] : {} response = @client.get "/profiles/#{@id}", body, return response end |
#shuffle(options = {}) ⇒ Object
Randomize the order at which statuses for the specified social media profile will be sent out of the buffer. ‘/profiles/:id/updates/shuffle’ POST
64 65 66 67 68 69 70 |
# File 'lib/buffer/api/profile.rb', line 64 def shuffle( = {}) body = .has_key?(:body) ? [:body] : {} response = @client.post "/profiles/#{@id}/updates/shuffle", body, return response end |