Class: Readmill::Client
- Inherits:
-
Object
- Object
- Readmill::Client
- Includes:
- Books, ClosingRemarks, Comments, Highlights, Locations, Periods, Readings, Search, Users, Request
- Defined in:
- lib/readmill/client.rb,
lib/readmill/client/books.rb,
lib/readmill/client/users.rb,
lib/readmill/client/search.rb,
lib/readmill/client/periods.rb,
lib/readmill/client/comments.rb,
lib/readmill/client/readings.rb,
lib/readmill/client/locations.rb,
lib/readmill/client/highlights.rb,
lib/readmill/client/closing_remarks.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, ClosingRemarks, Comments, Highlights, Locations, Periods, Readings, Search, Users
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 Users
Methods included from Search
Methods included from Readings
Methods included from Periods
Methods included from Locations
Methods included from Highlights
Methods included from Comments
Methods included from ClosingRemarks
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: {}).
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/readmill/client.rb', line 25 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.
40 41 42 |
# File 'lib/readmill/client.rb', line 40 def api_url "https://api.readmill.com/v2/" end |