Module: AuthlogicFacebookShim::Session::Config
- Defined in:
- lib/authlogic_facebook_shim/session/config.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#facebook_api_key(value = nil) ⇒ Object
(also: #facebook_api_key=)
Specify your api_key.
-
#facebook_app_id(value = nil) ⇒ Object
(also: #facebook_app_id=)
Specify your app_id.
-
#facebook_auto_register(value = nil) ⇒ Object
(also: #facebook_auto_register=)
Should a new user be automatically created if there is no user with given facebook uid?.
-
#facebook_config_file(value = nil) ⇒ Object
(also: #facebook_config_file=)
Specify your config file if using one.
-
#facebook_finder(value = nil) ⇒ Object
(also: #facebook_finder=)
What method should be used to find the facebook account?.
-
#facebook_secret_key(value = nil) ⇒ Object
(also: #facebook_secret_key=)
Specify your secret_key.
-
#facebook_uid_field(value = nil) ⇒ Object
(also: #facebook_uid_field=)
What user field should be used for the facebook UID?.
Class Method Details
.extended(klass) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/authlogic_facebook_shim/session/config.rb', line 6 def self.extended(klass) (class << klass; self end).send(:define_method, :default_config) do @default_config ||= begin config_file = File.join(Rails.root, 'config', facebook_config_file) OpenStruct.new(File.exist?(config_file) ? YAML.load_file(config_file)[Rails.env] : {}) end end end |
Instance Method Details
#facebook_api_key(value = nil) ⇒ Object Also known as: facebook_api_key=
Specify your api_key.
-
Default:
api_key in config/facebook.yml -
Accepts:
String
47 48 49 |
# File 'lib/authlogic_facebook_shim/session/config.rb', line 47 def facebook_api_key(value=nil) rw_config(:facebook_api_key, value, default_config.api_key) end |
#facebook_app_id(value = nil) ⇒ Object Also known as: facebook_app_id=
Specify your app_id.
-
Default:
app_id in config/facebook.yml -
Accepts:
String
29 30 31 |
# File 'lib/authlogic_facebook_shim/session/config.rb', line 29 def facebook_app_id(value=nil) rw_config(:facebook_app_id, value, default_config.app_id) end |
#facebook_auto_register(value = nil) ⇒ Object Also known as: facebook_auto_register=
Should a new user be automatically created if there is no user with given facebook uid?
-
Default:
false -
Accepts:
Boolean
75 76 77 |
# File 'lib/authlogic_facebook_shim/session/config.rb', line 75 def facebook_auto_register(value=nil) rw_config(:facebook_auto_register, value, false) end |
#facebook_config_file(value = nil) ⇒ Object Also known as: facebook_config_file=
Specify your config file if using one. If not then you need to specify facebook_app_id, facebook_secret_key & facebook_api_key
-
Default:
facebook.yml -
Accepts:
String
20 21 22 |
# File 'lib/authlogic_facebook_shim/session/config.rb', line 20 def facebook_config_file(value=nil) rw_config(:facebook_config_file, value, 'facebook.yml') end |
#facebook_finder(value = nil) ⇒ Object Also known as: facebook_finder=
What method should be used to find the facebook account?
-
Default:
:find_by_##facebook_uid_field -
Accepts:
Symbol or String
65 66 67 |
# File 'lib/authlogic_facebook_shim/session/config.rb', line 65 def facebook_finder(value=nil) rw_config(:facebook_finder, value, nil) end |
#facebook_secret_key(value = nil) ⇒ Object Also known as: facebook_secret_key=
Specify your secret_key.
-
Default:
secret_key in config/facebook.yml -
Accepts:
String
38 39 40 |
# File 'lib/authlogic_facebook_shim/session/config.rb', line 38 def facebook_secret_key(value=nil) rw_config(:facebook_secret_key, value, default_config.secret_key) end |
#facebook_uid_field(value = nil) ⇒ Object Also known as: facebook_uid_field=
What user field should be used for the facebook UID?
-
Default:
:facebook_uid -
Accepts:
Symbol
56 57 58 |
# File 'lib/authlogic_facebook_shim/session/config.rb', line 56 def facebook_uid_field(value=nil) rw_config(:facebook_uid_field, value, :facebook_uid) end |