Class: Koala::Configuration

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

Overview

Global configuration for Koala.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



49
50
51
52
53
54
55
# File 'lib/koala/configuration.rb', line 49

def initialize
  # Default to our default values.
  Koala::HTTPService::DEFAULT_SERVERS.each_pair do |key, value|
    self.public_send("#{key}=", value)
  end
  self.mask_tokens = true
end

Instance Attribute Details

#access_tokenObject

The default access token to be used if none is otherwise supplied.



4
5
6
# File 'lib/koala/configuration.rb', line 4

def access_token
  @access_token
end

#api_versionObject

The default API version to use if none is otherwise specified.



16
17
18
# File 'lib/koala/configuration.rb', line 16

def api_version
  @api_version
end

#app_access_tokenObject

The default app access token to be used if none is otherwise supplied.



13
14
15
# File 'lib/koala/configuration.rb', line 13

def app_access_token
  @app_access_token
end

#app_idObject

The default application ID to use if none is otherwise supplied.



10
11
12
# File 'lib/koala/configuration.rb', line 10

def app_id
  @app_id
end

#app_secretObject

The default app secret value to be used if none is otherwise supplied.



7
8
9
# File 'lib/koala/configuration.rb', line 7

def app_secret
  @app_secret
end

#beta_replaceObject

Returns the value of attribute beta_replace.



47
48
49
# File 'lib/koala/configuration.rb', line 47

def beta_replace
  @beta_replace
end

#dialog_hostObject

The server to use when constructing dialog URLs.



29
30
31
# File 'lib/koala/configuration.rb', line 29

def dialog_host
  @dialog_host
end

#graph_serverObject

The server to use for Graph API requests



26
27
28
# File 'lib/koala/configuration.rb', line 26

def graph_server
  @graph_server
end

#host_path_matcherObject

Certain Facebook services (beta, video) require you to access different servers. If you’re using your own servers, for instance, for a proxy, you can change both the matcher (what value to change when updating the URL) and the replacement values (what to add).

So, for instance, to use the beta stack, we match on .facebook and change it to .beta.facebook. If you’re talking to fbproxy.mycompany.com, you could set up beta.fbproxy.mycompany.com for FB’s beta tier, and set the matcher to /.fbproxy/ and the beta_replace to ‘.beta.fbproxy’.



45
46
47
# File 'lib/koala/configuration.rb', line 45

def host_path_matcher
  @host_path_matcher
end

#mask_tokensObject

Whether or not to mask tokens



32
33
34
# File 'lib/koala/configuration.rb', line 32

def mask_tokens
  @mask_tokens
end

#oauth_callback_urlObject

The default value to use for the oauth_callback_url if no other is provided.



19
20
21
# File 'lib/koala/configuration.rb', line 19

def oauth_callback_url
  @oauth_callback_url
end

#preserve_form_argumentsObject

Whether to preserve arrays in arguments, which are expected by certain FB APIs (see the ads API in particular, developers.facebook.com/docs/marketing-api/adgroup/v2.4)



23
24
25
# File 'lib/koala/configuration.rb', line 23

def preserve_form_arguments
  @preserve_form_arguments
end

#rate_limit_hookObject

Called with the info for the rate limits in the response header



35
36
37
# File 'lib/koala/configuration.rb', line 35

def rate_limit_hook
  @rate_limit_hook
end

#video_replaceObject

Returns the value of attribute video_replace.



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

def video_replace
  @video_replace
end