Module: Goodreads
- Defined in:
- lib/goodreads.rb,
lib/goodreads/client.rb,
lib/goodreads/errors.rb,
lib/goodreads/request.rb,
lib/goodreads/version.rb,
lib/goodreads/client/books.rb,
lib/goodreads/client/users.rb,
lib/goodreads/client/groups.rb,
lib/goodreads/client/authors.rb,
lib/goodreads/client/friends.rb,
lib/goodreads/client/reviews.rb,
lib/goodreads/client/shelves.rb,
lib/goodreads/client/authorized.rb
Defined Under Namespace
Modules: Authorized, Authors, Books, Friends, Groups, Request, Reviews, Shelves, Users Classes: Client, ConfigurationError, Error, NotFound, Unauthorized
Constant Summary collapse
- VERSION =
'0.2.2'.freeze
- @@options =
{}
Class Method Summary collapse
-
.configuration ⇒ Object
Returns global configuration hash.
-
.configure(options = {}) ⇒ Object
Define a global configuration.
-
.new(options = {}) ⇒ Object
Create a new Goodreads::Client instance.
-
.reset_configuration ⇒ Object
Resets the global configuration.
Class Method Details
.configuration ⇒ Object
Returns global configuration hash
32 33 34 |
# File 'lib/goodreads.rb', line 32 def self.configuration @@options end |
.configure(options = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/goodreads.rb', line 20 def self.configure(={}) unless .kind_of?(Hash) raise ArgumentError, "Options hash required." end @@options[:api_key] = [:api_key] @@options[:api_secret] = [:api_secret] @@options end |
.new(options = {}) ⇒ Object
Create a new Goodreads::Client instance
11 12 13 |
# File 'lib/goodreads.rb', line 11 def self.new(={}) Goodreads::Client.new() end |
.reset_configuration ⇒ Object
Resets the global configuration
38 39 40 |
# File 'lib/goodreads.rb', line 38 def self.reset_configuration @@options = {} end |