Class: Pinterest::Client

Inherits:
Object
  • Object
show all
Includes:
Board, Pin, User
Defined in:
lib/pinterest/client.rb,
lib/pinterest/client/pin.rb,
lib/pinterest/client/user.rb,
lib/pinterest/client/board.rb

Defined Under Namespace

Modules: Board, Pin, User

Constant Summary collapse

BASE_ENDPOINT =
'https://api.pinterest.com/v1/'.freeze
DEFAULT_USER_AGENT =
"Pinterest Ruby Gem #{Pinterest::VERSION}".freeze
DEFAULT_ADAPTER =
Faraday.default_adapter

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Board

#create_board, #delete_board, #get_board, #update_board

Methods included from Pin

#create_pin, #delete_pin, #get_board_pins, #get_pin, #update_pin

Methods included from User

#follow_board, #follow_interest, #follow_user, #get_boards, #get_followed_boards, #get_followed_interests, #get_followed_users, #get_followers, #get_likes, #get_pins, #get_user, #me, #unfollow_board, #unfollow_interest, #unfollow_user

Constructor Details

#initialize(access_token = nil, connection_options = {}) ⇒ Client

Returns a new instance of Client.



17
18
19
20
# File 'lib/pinterest/client.rb', line 17

def initialize(access_token = nil, connection_options={})
  @access_token = access_token
  @connection_options = connection_options
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



22
23
24
# File 'lib/pinterest/client.rb', line 22

def access_token
  @access_token
end

Instance Method Details

#delete(path, options = {}) ⇒ Object



40
41
42
# File 'lib/pinterest/client.rb', line 40

def delete(path, options={})
  request(:delete, path, options)
end

#get(path, options = {}) ⇒ Object



24
25
26
# File 'lib/pinterest/client.rb', line 24

def get(path, options={})
  request(:get, path, options)
end

#patch(path, options = {}) ⇒ Object



32
33
34
# File 'lib/pinterest/client.rb', line 32

def patch(path, options={})
  request(:patch, path, options)
end

#post(path, options = {}) ⇒ Object



28
29
30
# File 'lib/pinterest/client.rb', line 28

def post(path, options={})
  request(:post, path, options)
end

#put(path, options = {}) ⇒ Object



36
37
38
# File 'lib/pinterest/client.rb', line 36

def put(path, options={})
  request(:put, path, options)
end