Class: Readmill::Client
- Inherits:
-
Object
- Object
- Readmill::Client
- Defined in:
- lib/readmill/client.rb,
lib/readmill/client/books.rb
Overview
Public: The Client is what wraps all of the Readmill API. You will use this class to handle the majority of your interaction with Readmill.
Defined Under Namespace
Modules: Books
Instance Method Summary collapse
-
#api_url ⇒ Object
Public: Get the base URL for accessing the Readmill API.
-
#initialize(opts = {}) ⇒ Client
constructor
Public: Constructor for a Readmill::Client.
Methods included from Books
Methods included from Request
Constructor Details
#initialize(opts = {}) ⇒ Client
Public: Constructor for a Readmill::Client.
opts - A Hash of options to modify the client (default: {}).
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/readmill/client.rb', line 17 def initialize(opts={}) # TODO: Extract this, move it elsewhere. If this hasn't been configured, # I'm wondering if we raise an exception and move on? Readmill.configuration ||= Readmill::Configuration.new config = Readmill.configuration.values.merge(opts) Readmill::Configuration::VALID_CONFIGURATION_KEYS.each do |k| send("#{k}=", config[k]) end end |
Instance Method Details
#api_url ⇒ Object
Public: Get the base URL for accessing the Readmill API.
Returns a String.
32 33 34 |
# File 'lib/readmill/client.rb', line 32 def api_url "https://api.readmill.com/v2/" end |