Class: KapsoClientRuby::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration



56
57
58
59
60
61
62
63
64
65
66
# File 'lib/kapso_client_ruby.rb', line 56

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.



53
54
55
# File 'lib/kapso_client_ruby.rb', line 53

def access_token
  @access_token
end

#api_versionObject

Returns the value of attribute api_version.



53
54
55
# File 'lib/kapso_client_ruby.rb', line 53

def api_version
  @api_version
end

#base_urlObject

Returns the value of attribute base_url.



53
54
55
# File 'lib/kapso_client_ruby.rb', line 53

def base_url
  @base_url
end

#debugObject

Returns the value of attribute debug.



53
54
55
# File 'lib/kapso_client_ruby.rb', line 53

def debug
  @debug
end

#kapso_api_keyObject

Returns the value of attribute kapso_api_key.



53
54
55
# File 'lib/kapso_client_ruby.rb', line 53

def kapso_api_key
  @kapso_api_key
end

#max_retriesObject

Returns the value of attribute max_retries.



53
54
55
# File 'lib/kapso_client_ruby.rb', line 53

def max_retries
  @max_retries
end

#open_timeoutObject

Returns the value of attribute open_timeout.



53
54
55
# File 'lib/kapso_client_ruby.rb', line 53

def open_timeout
  @open_timeout
end

#retry_delayObject

Returns the value of attribute retry_delay.



53
54
55
# File 'lib/kapso_client_ruby.rb', line 53

def retry_delay
  @retry_delay
end

#timeoutObject

Returns the value of attribute timeout.



53
54
55
# File 'lib/kapso_client_ruby.rb', line 53

def timeout
  @timeout
end

Instance Method Details

#kapso_proxy?Boolean



68
69
70
# File 'lib/kapso_client_ruby.rb', line 68

def kapso_proxy?
  !@kapso_api_key.nil? && @base_url&.include?('kapso')
end

#valid?Boolean



72
73
74
# File 'lib/kapso_client_ruby.rb', line 72

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