Module: Facebooker2
- Defined in:
- lib/facebooker2.rb,
lib/facebooker2/rails.rb,
lib/facebooker2/rails/helpers.rb,
lib/facebooker2/rails/controller.rb,
lib/facebooker2/rails/helpers/user.rb,
lib/facebooker2/rails/helpers/javascript.rb,
lib/facebooker2/rails/helpers/request_forms.rb,
lib/facebooker2/rails/helpers/facebook_connect.rb
Defined Under Namespace
Modules: Rails Classes: NotConfigured
Class Attribute Summary collapse
-
.api_key ⇒ Object
Returns the value of attribute api_key.
-
.app_id ⇒ Object
Returns the value of attribute app_id.
-
.secret ⇒ Object
Returns the value of attribute secret.
Class Method Summary collapse
- .cast_to_facebook_id(object) ⇒ Object
- .configuration=(hash) ⇒ Object
- .load_facebooker_yaml ⇒ Object
- .raise_unconfigured_exception ⇒ Object
Class Attribute Details
.api_key ⇒ Object
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/facebooker2.rb', line 6 def api_key @api_key end |
.app_id ⇒ Object
Returns the value of attribute app_id.
6 7 8 |
# File 'lib/facebooker2.rb', line 6 def app_id @app_id end |
.secret ⇒ Object
Returns the value of attribute secret.
6 7 8 |
# File 'lib/facebooker2.rb', line 6 def secret @secret end |
Class Method Details
.cast_to_facebook_id(object) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/facebooker2.rb', line 33 def self.cast_to_facebook_id(object) if object.kind_of?(Mogli::Profile) object.id elsif object.respond_to?(:facebook_id) object.facebook_id else object end end |
.configuration=(hash) ⇒ Object
21 22 23 24 25 |
# File 'lib/facebooker2.rb', line 21 def self.configuration=(hash) self.api_key = hash[:api_key] self.secret = hash[:secret] self.app_id = hash[:app_id] end |
.load_facebooker_yaml ⇒ Object
27 28 29 30 31 |
# File 'lib/facebooker2.rb', line 27 def self.load_facebooker_yaml config = YAML.load(File.read(File.join(::Rails.root,"config","facebooker.yml")))[::Rails.env] raise NotConfigured.new("Unable to load configuration for #{::Rails.env} from facebooker.yml. Is it set up?") if config.nil? self.configuration = config.with_indifferent_access end |
.raise_unconfigured_exception ⇒ Object
17 18 19 |
# File 'lib/facebooker2.rb', line 17 def self.raise_unconfigured_exception raise NotConfigured.new("No configuration provided for Facebooker2. Either set the app_id and secret or call Facebooker2.load_facebooker_yaml in an initializer") end |