Module: ReamazeAPI
- Defined in:
- lib/reamaze_api.rb,
lib/reamaze_api/error.rb,
lib/reamaze_api/utils.rb,
lib/reamaze_api/client.rb,
lib/reamaze_api/article.rb,
lib/reamaze_api/channel.rb,
lib/reamaze_api/contact.rb,
lib/reamaze_api/message.rb,
lib/reamaze_api/version.rb,
lib/reamaze_api/resource.rb,
lib/reamaze_api/conversation.rb,
lib/reamaze_api/utils/hash_keys.rb
Defined Under Namespace
Modules: Utils Classes: Article, Channel, Client, ClientError, Config, Contact, Conversation, Error, Forbidden, Message, NotFound, Resource, ServerError, TooManyRequests, UnprocessableEntity
Constant Summary
- VERSION =
"0.7.1"
Class Method Summary collapse
-
.config { ... } ⇒ Object
Optional default configuration used to authenticate with the Reamaze API.
-
.new(**credentials, &block) ⇒ Object
Initializes a new API Client instance.
Class Method Details
.config { ... } ⇒ Object
Optional default configuration used to authenticate with the Reamaze API.
22 23 24 25 26 |
# File 'lib/reamaze_api.rb', line 22 def self.config @config ||= Config.new yield @config if block_given? @config end |
.new(**credentials, &block) ⇒ Object
Initializes a new API Client instance.
**credentials - Credentials used with the Reamaze API (optional)
:brand - Brand name (subdomain from your Reamaze URL)
:login - Reamaze login
:token - Reamaze API token
44 45 46 47 48 49 50 51 52 |
# File 'lib/reamaze_api.rb', line 44 def self.new(**credentials, &block) params = { brand: credentials.fetch(:brand) { config.brand }, login: credentials.fetch(:login) { config.login }, token: credentials.fetch(:token) { config.token }, } Client.new(**params, &block) end |