Module: FBGraph

Defined in:
lib/fbgraph.rb,
lib/fbgraph/fql.rb,
lib/fbgraph/base.rb,
lib/fbgraph/logger.rb,
lib/fbgraph/search.rb,
lib/fbgraph/canvas.rb,
lib/fbgraph/result.rb,
lib/fbgraph/client.rb,
lib/fbgraph/version.rb,
lib/fbgraph/realtime.rb,
lib/fbgraph/timeline.rb,
lib/fbgraph/selection.rb,
lib/fbgraph/authorization.rb

Defined Under Namespace

Classes: Authorization, Base, Canvas, Client, FQL, Logger, Realtime, Result, Search, Selection, Timeline

Constant Summary

VERSION =
'1.10.0'

Class Method Summary (collapse)

Class Method Details

+ (Object) config



28
29
30
# File 'lib/fbgraph.rb', line 28

def config
  @config ||= load_config(config_path).freeze
end

+ (Object) config_path



32
33
34
35
36
37
38
# File 'lib/fbgraph.rb', line 32

def config_path
  if defined?(Rails)
    File.join(Rails.root , 'config' , 'facebook.yml')
  else
    'facebook.yml'
  end
end

+ (Object) load_config(yaml_file)



40
41
42
43
44
45
46
47
# File 'lib/fbgraph.rb', line 40

def load_config(yaml_file)
  return {} unless File.exist?(yaml_file)
  cfg = YAML::load(File.open(yaml_file))
  if defined? Rails
    cfg = cfg[Rails.env]
  end
  cfg
end