Class: Buffer::Api::Profile

Inherits:
Object
  • Object
show all
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

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(options = {})
  body = options.has_key?(:query) ? options[:query] : {}

  response = @client.get "/profiles/#{@id}/updates/pending", body, options

  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, options = {})
  body = options.has_key?(:body) ? options[:body] : {}
  body[:order] = order

  response = @client.post "/profiles/#{@id}/updates/reorder", body, options

  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(options = {})
  body = options.has_key?(:query) ? options[:query] : {}

  response = @client.get "/profiles/#{@id}/updates/sent", body, options

  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(options = {})
  body = options.has_key?(:query) ? options[:query] : {}

  response = @client.get "/profiles/#{@id}", body, options

  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(options = {})
  body = options.has_key?(:body) ? options[:body] : {}

  response = @client.post "/profiles/#{@id}/updates/shuffle", body, options

  return response
end