Module: FbGraphRails::FbConfig::ClassMethods
- Defined in:
- lib/fb_graph_rails/fb_config.rb
Instance Method Summary collapse
- #fb_app ⇒ Object
- #fb_auth(redirect_uri = nil) ⇒ Object
- #fb_auth_scope ⇒ Object
- #fb_canvas_url ⇒ Object
- #fb_config ⇒ Object
- #fb_model ⇒ Object
Instance Method Details
#fb_app ⇒ Object
12 13 14 |
# File 'lib/fb_graph_rails/fb_config.rb', line 12 def fb_app FbGraph::Application.new fb_config[:client_id], :secret => fb_config[:client_secret] end |
#fb_auth(redirect_uri = nil) ⇒ Object
16 17 18 |
# File 'lib/fb_graph_rails/fb_config.rb', line 16 def fb_auth(redirect_uri = nil) FbGraph::Auth.new fb_config[:client_id], fb_config[:client_secret], :redirect_uri => redirect_uri end |
#fb_auth_scope ⇒ Object
29 30 31 |
# File 'lib/fb_graph_rails/fb_config.rb', line 29 def fb_auth_scope @_auth_scope ||= fb_config[:scope] end |
#fb_canvas_url ⇒ Object
25 26 27 |
# File 'lib/fb_graph_rails/fb_config.rb', line 25 def fb_canvas_url @_canvas_url ||= fb_config[:canvas_url] end |
#fb_config ⇒ Object
6 7 8 9 10 |
# File 'lib/fb_graph_rails/fb_config.rb', line 6 def fb_config YAML.load_file("#{Rails.root}/config/facebook.yml")[Rails.env].symbolize_keys rescue Errno::ENOENT => e raise StandardError.new("config/facebook.yml could not be loaded.") end |
#fb_model ⇒ Object
20 21 22 23 |
# File 'lib/fb_graph_rails/fb_config.rb', line 20 def fb_model @_model ||= fb_config[:model].constantize #TODO: say why the class could not be found end |