Class: Pinterest::Client
- Inherits:
-
Object
show all
- Includes:
- HTTP
- Defined in:
- lib/pinterest/client.rb
Constant Summary
collapse
- CONFIG_KEYS =
%i[
api_type
api_version
access_token
refresh_token
client_id
secret_key
uri_base
request_timeout
extra_headers
].freeze
Instance Method Summary
collapse
Methods included from HTTP
#delete, #get, #json_post, #multipart_post, #oauth_post, #patch
Constructor Details
#initialize(config = {}) ⇒ Client
Returns a new instance of Client.
18
19
20
21
22
23
24
|
# File 'lib/pinterest/client.rb', line 18
def initialize(config = {})
CONFIG_KEYS.each do |key|
instance_variable_set("@#{key}", config[key] || Pinterest.configuration.send(key))
end
end
|
Instance Method Details
#boards ⇒ Object
26
27
28
|
# File 'lib/pinterest/client.rb', line 26
def boards
@boards ||= Pinterest::Boards.new(client: self)
end
|
#keywords ⇒ Object
38
39
40
|
# File 'lib/pinterest/client.rb', line 38
def keywords
@pins ||= Pinterest::Keywords.new(client: self)
end
|
46
47
48
|
# File 'lib/pinterest/client.rb', line 46
def media
@media ||= Pinterest::Media.new(client: self)
end
|
#oauth ⇒ Object
42
43
44
|
# File 'lib/pinterest/client.rb', line 42
def oauth
@oauth ||= Pinterest::Oauth.new(client: self)
end
|
#pins ⇒ Object
30
31
32
|
# File 'lib/pinterest/client.rb', line 30
def pins
@pins ||= Pinterest::Pins.new(client: self)
end
|
#terms ⇒ Object
34
35
36
|
# File 'lib/pinterest/client.rb', line 34
def terms
@terms ||= Pinterest::Terms.new(client: self)
end
|
#user_account ⇒ Object
50
51
52
|
# File 'lib/pinterest/client.rb', line 50
def user_account
@user_account ||= Pinterest::UserAccount.new(client: self)
end
|