Class: Buffer::Api::User
- Inherits:
-
Object
- Object
- Buffer::Api::User
- Defined in:
- lib/buffer/api/user.rb
Overview
Returns authenticated user api instance.
Instance Method Summary collapse
-
#create_update(text, profile_ids, options = {}) ⇒ Object
Create one or more new status updates.
-
#initialize(client) ⇒ User
constructor
A new instance of User.
-
#profiles(options = {}) ⇒ Object
Returns an array of social media profiles connected to the authenticated users account.
-
#show(options = {}) ⇒ Object
Returns information about the authenticated user.
Constructor Details
#initialize(client) ⇒ User
Returns a new instance of User.
9 10 11 |
# File 'lib/buffer/api/user.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#create_update(text, profile_ids, options = {}) ⇒ Object
Create one or more new status updates. ‘/updates/create’ POST
text - The status update text. profile_ids - An array of profile id’s that the status update should be sent to. Invalid profile_id’s will be silently ignored.
40 41 42 43 44 45 46 47 48 |
# File 'lib/buffer/api/user.rb', line 40 def create_update(text, profile_ids, = {}) body = .has_key?(:body) ? [:body] : {} body[:text] = text body[:profile_ids] = profile_ids response = @client.post "/updates/create", body, return response end |
#profiles(options = {}) ⇒ Object
Returns an array of social media profiles connected to the authenticated users account. ‘/profiles’ GET
27 28 29 30 31 32 33 |
# File 'lib/buffer/api/user.rb', line 27 def profiles( = {}) body = .has_key?(:query) ? [:query] : {} response = @client.get "/profiles", body, return response end |
#show(options = {}) ⇒ Object
Returns information about the authenticated user. ‘/user’ GET
16 17 18 19 20 21 22 |
# File 'lib/buffer/api/user.rb', line 16 def show( = {}) body = .has_key?(:query) ? [:query] : {} response = @client.get "/user", body, return response end |