Class: WordstreamClient::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Client

Returns a new instance of Client.



7
8
9
10
11
12
13
14
15
# File 'lib/wordstream_client/client.rb', line 7

def initialize(config)
  @config = if config.is_a?(Hash)
    Config.new(config)
  elsif config.is_a?(WordstreamClient::Config)
    config
  else
    raise ArgumentError, 'invalid configuration for client.'
  end
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



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

def config
  @config
end

Instance Method Details

#authObject



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

def auth
  Auth.new @config
end

#keyword_tool(keywords) ⇒ Object



21
22
23
# File 'lib/wordstream_client/client.rb', line 21

def keyword_tool(keywords)
  KeywordTool.new @config, keywords
end