Module: Facebooker3
- Defined in:
- lib/facebooker3.rb,
lib/facebooker3/logging.rb
Defined Under Namespace
Modules: FacebookSignedRequest, Logging
Constant Summary
collapse
- @@logger =
nil
Class Method Summary
collapse
Class Method Details
.apply_configuration(config) ⇒ Object
Sets the Facebook environment based on a hash of options. By default the hash passed in is loaded from facebooker3.yml, but it can also be passed in manually every request to run multiple Facebook apps off one Rails app.
18
19
20
21
22
23
24
25
26
|
# File 'lib/facebooker3.rb', line 18
def apply_configuration(config)
ENV['FACEBOOK_APP_ID'] = config['app_id']
ENV['FACEBOOK_API_KEY'] = config['api_key']
ENV['FACEBOOK_SECRET_KEY'] = config['secret_key']
ENV['FACEBOOK_RELATIVE_ROOT_URL'] = config['canvas_page_name']
@facebooker3_configuration = config
facebooker3_config
end
|
.facebooker3_config ⇒ Object
28
29
30
|
# File 'lib/facebooker3.rb', line 28
def facebooker3_config
@facebooker3_configuration
end
|
.load_configuration(facebooker3_yaml_file) ⇒ Object
6
7
8
9
10
11
12
13
|
# File 'lib/facebooker3.rb', line 6
def load_configuration(facebooker3_yaml_file)
return false unless File.exist?(facebooker3_yaml_file)
@raw_facebooker3_configuration = YAML.load(ERB.new(File.read(facebooker3_yaml_file)).result)
if Rails.env
@raw_facebooker3_configuration = @raw_facebooker3_configuration[Rails.env]
end
apply_configuration(@raw_facebooker3_configuration)
end
|
.logger ⇒ Object
6
7
8
|
# File 'lib/facebooker3/logging.rb', line 6
def self.logger
@@logger
end
|
.logger=(logger) ⇒ Object
3
4
5
|
# File 'lib/facebooker3/logging.rb', line 3
def self.logger=(logger)
@@logger = logger
end
|