Class: Pinterest::Client
- Inherits:
-
Object
- Object
- Pinterest::Client
- Defined in:
- lib/pinterest/client.rb,
lib/pinterest/client/pin.rb,
lib/pinterest/client/user.rb,
lib/pinterest/client/board.rb
Defined Under Namespace
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
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
Instance Method Summary collapse
- #delete(path, options = {}) ⇒ Object
- #get(path, options = {}) ⇒ Object
-
#initialize(access_token = nil, connection_options = {}) ⇒ Client
constructor
A new instance of Client.
- #patch(path, options = {}) ⇒ Object
- #post(path, options = {}) ⇒ Object
- #put(path, options = {}) ⇒ Object
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, ={}) @access_token = access_token @connection_options = end |
Instance Attribute Details
#access_token ⇒ Object (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, ={}) request(:delete, path, ) end |
#get(path, options = {}) ⇒ Object
24 25 26 |
# File 'lib/pinterest/client.rb', line 24 def get(path, ={}) request(:get, path, ) end |
#patch(path, options = {}) ⇒ Object
32 33 34 |
# File 'lib/pinterest/client.rb', line 32 def patch(path, ={}) request(:patch, path, ) end |
#post(path, options = {}) ⇒ Object
28 29 30 |
# File 'lib/pinterest/client.rb', line 28 def post(path, ={}) request(:post, path, ) end |
#put(path, options = {}) ⇒ Object
36 37 38 |
# File 'lib/pinterest/client.rb', line 36 def put(path, ={}) request(:put, path, ) end |