Class: TimesBooks::Client

Inherits:
Object
  • Object
show all
Includes:
List, Request
Defined in:
lib/times_books/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from List

#getListByName, #getLists, #getListsByDate, #searchLists, #searchReviews

Methods included from Request

#parse, #request

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



8
9
10
11
# File 'lib/times_books/client.rb', line 8

def initialize(options = {})
  fail(ArgumentError, "Options hash required.") unless options.is_a?(Hash)
  @api_key    = options[:api_key] || TimesBooks.configuration[:api_key]
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



6
7
8
# File 'lib/times_books/client.rb', line 6

def api_key
  @api_key
end