Module: FacebookGraphr

Defined in:
lib/facebook_graphr.rb,
lib/facebook_graphr/helpers.rb,
lib/facebook_graphr/controller.rb

Defined Under Namespace

Modules: Helpers, Rails Classes: Session

Constant Summary collapse

BASE_URL =
"https://graph.facebook.com"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject



7
8
9
10
11
12
13
# File 'lib/facebook_graphr.rb', line 7

def config
  if defined?(@config)
    @config
  else
    raise "Tried to access FacebookGraphr.config without calling FacebookGraphr.setup"
  end
end

Class Method Details

.setup(yml_file) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/facebook_graphr.rb', line 14

def setup(yml_file)
  hash = File.open(yml_file) do |f|
    YAML::load(f)
  end
  self.config = if defined?(Rails)
    hash[::Rails.env].symbolize_keys
  else
    hash.symbolize_keys
  end
end