Class: Buffer::Client

Inherits:
Object
  • Object
show all
Includes:
Core, Info, Link, Profile, Update, User
Defined in:
lib/buffer/core.rb,
lib/buffer/info.rb,
lib/buffer/link.rb,
lib/buffer/user.rb,
lib/buffer/client.rb,
lib/buffer/update.rb,
lib/buffer/profile.rb

Defined Under Namespace

Modules: Core, Info, Link, Profile, Update, User

Constant Summary collapse

URL =
'https://api.bufferapp.com/1/'.freeze

Constants included from Core

Core::API_VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Info

#info

Methods included from Link

#link

Methods included from Update

#check_id, #create_update, #destroy_update, #interactions_by_update_id, #modify_update_text, #reorder_updates, #share_update, #shuffle_updates, #update_by_id, #updates_by_profile_id

Methods included from Profile

#profile_by_id, #profiles, #schedules_by_profile_id, #set_schedules

Methods included from User

#user_info

Constructor Details

#initialize(access_token) ⇒ Client

Returns a new instance of Client.



14
15
16
# File 'lib/buffer/client.rb', line 14

def initialize(access_token)
  @access_token = access_token
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



10
11
12
# File 'lib/buffer/client.rb', line 10

def access_token
  @access_token
end

Instance Method Details

#auth_queryObject



25
26
27
# File 'lib/buffer/client.rb', line 25

def auth_query
  { access_token: @access_token }
end

#connectionObject



18
19
20
21
22
23
# File 'lib/buffer/client.rb', line 18

def connection
  @connection ||= Faraday.new(url: URL) do |faraday|
    faraday.request :url_encoded
    faraday.adapter Faraday.default_adapter
  end
end