Class: WhatsAppCloudApi::Configuration
- Inherits:
-
Object
- Object
- WhatsAppCloudApi::Configuration
- Defined in:
- lib/whatsapp_cloud_api.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#kapso_api_key ⇒ Object
Returns the value of attribute kapso_api_key.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#retry_delay ⇒ Object
Returns the value of attribute retry_delay.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #kapso_proxy? ⇒ Boolean
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/whatsapp_cloud_api.rb', line 49 def initialize @debug = false @timeout = 60 @open_timeout = 10 @max_retries = 3 @retry_delay = 1.0 @base_url = 'https://graph.facebook.com' @api_version = 'v23.0' @access_token = nil @kapso_api_key = nil end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
46 47 48 |
# File 'lib/whatsapp_cloud_api.rb', line 46 def access_token @access_token end |
#api_version ⇒ Object
Returns the value of attribute api_version.
46 47 48 |
# File 'lib/whatsapp_cloud_api.rb', line 46 def api_version @api_version end |
#base_url ⇒ Object
Returns the value of attribute base_url.
46 47 48 |
# File 'lib/whatsapp_cloud_api.rb', line 46 def base_url @base_url end |
#debug ⇒ Object
Returns the value of attribute debug.
46 47 48 |
# File 'lib/whatsapp_cloud_api.rb', line 46 def debug @debug end |
#kapso_api_key ⇒ Object
Returns the value of attribute kapso_api_key.
46 47 48 |
# File 'lib/whatsapp_cloud_api.rb', line 46 def kapso_api_key @kapso_api_key end |
#max_retries ⇒ Object
Returns the value of attribute max_retries.
46 47 48 |
# File 'lib/whatsapp_cloud_api.rb', line 46 def max_retries @max_retries end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
46 47 48 |
# File 'lib/whatsapp_cloud_api.rb', line 46 def open_timeout @open_timeout end |
#retry_delay ⇒ Object
Returns the value of attribute retry_delay.
46 47 48 |
# File 'lib/whatsapp_cloud_api.rb', line 46 def retry_delay @retry_delay end |
#timeout ⇒ Object
Returns the value of attribute timeout.
46 47 48 |
# File 'lib/whatsapp_cloud_api.rb', line 46 def timeout @timeout end |
Instance Method Details
#kapso_proxy? ⇒ Boolean
61 62 63 |
# File 'lib/whatsapp_cloud_api.rb', line 61 def kapso_proxy? !@kapso_api_key.nil? && @base_url&.include?('kapso') end |
#valid? ⇒ Boolean
65 66 67 |
# File 'lib/whatsapp_cloud_api.rb', line 65 def valid? !@access_token.nil? || !@kapso_api_key.nil? end |