Class: WhatsappSdk::Configuration
- Inherits:
-
Object
- Object
- WhatsappSdk::Configuration
- Defined in:
- lib/whatsapp_sdk/configuration.rb
Overview
This module allows client instantiating the client as a singleton like the following example: WhatsappSdk.configure do |config|
config.access_token = ACCESS_TOKEN
config.api_version = API_VERSION
end
The gem have access to the client through WhatsappSdk.configuration.client
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#logger ⇒ Object
loggers like ActiveSupport::Logger (Rails.logger) is a subclass of Logger.
-
#logger_options ⇒ Object
loggers like ActiveSupport::Logger (Rails.logger) is a subclass of Logger.
Instance Method Summary collapse
- #client ⇒ Object
-
#initialize(access_token = "", api_version = Api::ApiConfiguration::DEFAULT_API_VERSION, logger = nil, logger_options = {}) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(access_token = "", api_version = Api::ApiConfiguration::DEFAULT_API_VERSION, logger = nil, logger_options = {}) ⇒ Configuration
Returns a new instance of Configuration.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/whatsapp_sdk/configuration.rb', line 17 def initialize( access_token = "", api_version = Api::ApiConfiguration::DEFAULT_API_VERSION, logger = nil, = {} ) @access_token = access_token @api_version = api_version @logger = logger @logger_options = end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
12 13 14 |
# File 'lib/whatsapp_sdk/configuration.rb', line 12 def access_token @access_token end |
#api_version ⇒ Object
Returns the value of attribute api_version.
12 13 14 |
# File 'lib/whatsapp_sdk/configuration.rb', line 12 def api_version @api_version end |
#logger ⇒ Object
loggers like ActiveSupport::Logger (Rails.logger) is a subclass of Logger
15 16 17 |
# File 'lib/whatsapp_sdk/configuration.rb', line 15 def logger @logger end |
#logger_options ⇒ Object
loggers like ActiveSupport::Logger (Rails.logger) is a subclass of Logger
15 16 17 |
# File 'lib/whatsapp_sdk/configuration.rb', line 15 def @logger_options end |