Class: Goodreads::Client
- Inherits:
-
Object
- Object
- Goodreads::Client
- Defined in:
- lib/goodreads/client.rb
Constant Summary
Constants included from Request
Request::API_FORMAT, Request::API_URL
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#api_secret ⇒ Object
readonly
Returns the value of attribute api_secret.
-
#oauth_token ⇒ Object
readonly
Returns the value of attribute oauth_token.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
Initialize a Goodreads::Client instance.
Methods included from Friends
Methods included from Groups
Methods included from Authorized
Methods included from Shelves
Methods included from Users
Methods included from Authors
Methods included from Reviews
#recent_reviews, #review, #reviews
Methods included from Books
#book, #book_by_isbn, #book_by_title, #search_books
Constructor Details
#initialize(options = {}) ⇒ Client
31 32 33 34 35 36 37 38 39 |
# File 'lib/goodreads/client.rb', line 31 def initialize(={}) unless .kind_of?(Hash) raise ArgumentError, "Options hash required." end @api_key = [:api_key] || Goodreads.configuration[:api_key] @api_secret = [:api_secret] || Goodreads.configuration[:api_secret] @oauth_token = [:oauth_token] end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
23 24 25 |
# File 'lib/goodreads/client.rb', line 23 def api_key @api_key end |
#api_secret ⇒ Object (readonly)
Returns the value of attribute api_secret.
23 24 25 |
# File 'lib/goodreads/client.rb', line 23 def api_secret @api_secret end |
#oauth_token ⇒ Object (readonly)
Returns the value of attribute oauth_token.
23 24 25 |
# File 'lib/goodreads/client.rb', line 23 def oauth_token @oauth_token end |