Class: WordstreamClient::Client
- Inherits:
-
Object
- Object
- WordstreamClient::Client
- Defined in:
- lib/wordstream_client/client.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #auth ⇒ Object
-
#initialize(config) ⇒ Client
constructor
A new instance of Client.
- #keyword_tool(keywords) ⇒ Object
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
#config ⇒ Object (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
#auth ⇒ Object
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 |