Class: Infogram::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/infogram/client.rb

Constant Summary collapse

API_URL =
'https://infogr.am/service/v1'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, api_secret) ⇒ Client

Returns a new instance of Client.



7
8
9
# File 'lib/infogram/client.rb', line 7

def initialize(api_key, api_secret)
  config(api_key: api_key, api_secret: api_secret)
end

Instance Attribute Details

#config(opts = {}) ⇒ Object

Returns the value of attribute config.



5
6
7
# File 'lib/infogram/client.rb', line 5

def config
  @config
end

Instance Method Details

#infographicsObject



23
24
25
# File 'lib/infogram/client.rb', line 23

def infographics
  @infographics ||= Infogram::Infographics.new(config)
end

#themesObject



19
20
21
# File 'lib/infogram/client.rb', line 19

def themes
  @themes ||= Infogram::Themes.new(config)
end

#usersObject



27
28
29
# File 'lib/infogram/client.rb', line 27

def users
  @users ||= Infogram::Users.new(config)
end