Module: TocDoc
- Extended by:
- Configurable
- Defined in:
- lib/toc_doc.rb,
lib/toc_doc/client.rb,
lib/toc_doc/core/error.rb,
lib/toc_doc/core/default.rb,
lib/toc_doc/core/version.rb,
lib/toc_doc/models/place.rb,
lib/toc_doc/models/agenda.rb,
lib/toc_doc/models/search.rb,
lib/toc_doc/core/uri_utils.rb,
lib/toc_doc/models/profile.rb,
lib/toc_doc/core/connection.rb,
lib/toc_doc/models/resource.rb,
lib/toc_doc/core/configurable.rb,
lib/toc_doc/models/speciality.rb,
lib/toc_doc/cache/memory_store.rb,
lib/toc_doc/core/authentication.rb,
lib/toc_doc/models/availability.rb,
lib/toc_doc/models/booking_info.rb,
lib/toc_doc/models/visit_motive.rb,
lib/toc_doc/models/search/result.rb,
lib/toc_doc/http/middleware/cache.rb,
lib/toc_doc/http/middleware/logging.rb,
lib/toc_doc/http/middleware/raise_error.rb,
lib/toc_doc/models/profile/organization.rb,
lib/toc_doc/models/profile/practitioner.rb,
lib/toc_doc/http/middleware/rate_limiter.rb,
lib/toc_doc/http/rate_limiter/token_bucket.rb,
lib/toc_doc/models/availability/collection.rb
Overview
The main module for TocDoc — a Ruby client for the Doctolib API.
Configuration can be set at the module level and will be inherited by every Client instance created via TocDoc.client or TocDoc.setup.
Defined Under Namespace
Modules: Authentication, Cache, Configurable, Connection, Default, Middleware, RateLimiter, UriUtils Classes: Agenda, Availability, BadRequest, BookingInfo, Client, ClientError, ConnectionError, Error, NotFound, Place, Profile, Resource, ResponseError, Search, ServerError, Speciality, TooManyRequests, UnprocessableEntity, VisitMotive
Constant Summary collapse
- VERSION =
The current version of the TocDoc gem.
'1.10.0'
Constants included from Configurable
Configurable::VALID_CONFIG_KEYS
Class Attribute Summary collapse
-
.client ⇒ TocDoc::Client
Returns a memoized Client configured with the current module-level options.
Class Method Summary collapse
-
.availabilities ⇒ TocDoc::Availability::Collection
Returns available appointment slots.
-
.booking_info(identifier) ⇒ TocDoc::BookingInfo
Fetches booking context data for a profile by slug or numeric ID.
-
.profile(identifier) ⇒ TocDoc::Profile::Practitioner, TocDoc::Profile::Organization
Fetches a full profile page by slug or numeric ID.
-
.search ⇒ TocDoc::Search::Result, ...
Queries the autocomplete / search endpoint.
-
.setup {|config| ... } ⇒ TocDoc::Client
Configure TocDoc at the module level and return the client.
Methods included from Configurable
configure, keys, options, pagination_depth=, per_page=, reset!, same_options?
Class Attribute Details
.client ⇒ TocDoc::Client
Returns a memoized Client configured with the current module-level options. A new client is created whenever the options have changed since the last call.
41 42 43 44 45 46 |
# File 'lib/toc_doc.rb', line 41 def client if !defined?(@client) || @client.nil? || !@client.respond_to?(:same_options?) || !@client.() @client = TocDoc::Client.new() end @client end |
Class Method Details
.availabilities ⇒ TocDoc::Availability::Collection
Returns available appointment slots.
Delegates to TocDoc::Availability.where — see that method for full parameter documentation.
75 76 77 |
# File 'lib/toc_doc.rb', line 75 def availabilities(**) TocDoc::Availability.where(**) end |
.booking_info(identifier) ⇒ TocDoc::BookingInfo
Fetches booking context data for a profile by slug or numeric ID.
Delegates to TocDoc::BookingInfo.find — see that method for full parameter documentation.
110 111 112 |
# File 'lib/toc_doc.rb', line 110 def booking_info(identifier) TocDoc::BookingInfo.find(identifier) end |
.profile(identifier) ⇒ TocDoc::Profile::Practitioner, TocDoc::Profile::Organization
Fetches a full profile page by slug or numeric ID.
Delegates to TocDoc::Profile.find — see that method for full parameter documentation.
99 100 101 |
# File 'lib/toc_doc.rb', line 99 def profile(identifier) TocDoc::Profile.find(identifier) end |
.search ⇒ TocDoc::Search::Result, ...
Queries the autocomplete / search endpoint.
Delegates to TocDoc::Search.where — see that method for full parameter documentation.
88 89 90 |
# File 'lib/toc_doc.rb', line 88 def search(**) TocDoc::Search.where(**) end |
.setup {|config| ... } ⇒ TocDoc::Client
Configure TocDoc at the module level and return the client.
64 65 66 67 |
# File 'lib/toc_doc.rb', line 64 def setup yield self if block_given? client end |