Class: WhatsAppCloudApi::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/whatsapp_cloud_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_tokenObject

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_versionObject

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_urlObject

Returns the value of attribute base_url.



46
47
48
# File 'lib/whatsapp_cloud_api.rb', line 46

def base_url
  @base_url
end

#debugObject

Returns the value of attribute debug.



46
47
48
# File 'lib/whatsapp_cloud_api.rb', line 46

def debug
  @debug
end

#kapso_api_keyObject

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_retriesObject

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_timeoutObject

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_delayObject

Returns the value of attribute retry_delay.



46
47
48
# File 'lib/whatsapp_cloud_api.rb', line 46

def retry_delay
  @retry_delay
end

#timeoutObject

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

Returns:

  • (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

Returns:

  • (Boolean)


65
66
67
# File 'lib/whatsapp_cloud_api.rb', line 65

def valid?
  !@access_token.nil? || !@kapso_api_key.nil?
end