Module: Configurable
- Included in:
- RFb
- Defined in:
- lib/r_fb/configurable.rb
Instance Method Summary collapse
- #api_key ⇒ Object
- #api_key=(key) ⇒ Object
- #app_name ⇒ Object
- #app_name=(name) ⇒ Object
- #app_url ⇒ Object
- #debug ⇒ Object
- #debug=(value) ⇒ Object
- #environment ⇒ Object
- #environment=(env) ⇒ Object
- #secret_key ⇒ Object
- #secret_key=(secr) ⇒ Object
Instance Method Details
#api_key ⇒ Object
12 13 14 |
# File 'lib/r_fb/configurable.rb', line 12 def api_key ENV["rfb_api_key"] end |
#api_key=(key) ⇒ Object
9 10 11 |
# File 'lib/r_fb/configurable.rb', line 9 def api_key=(key) ENV["rfb_api_key"] = key[environment.to_sym] end |
#app_name ⇒ Object
26 27 28 |
# File 'lib/r_fb/configurable.rb', line 26 def app_name ENV["rfb_app_name"] end |
#app_name=(name) ⇒ Object
23 24 25 |
# File 'lib/r_fb/configurable.rb', line 23 def app_name=(name) ENV["rfb_app_name"] = name end |
#app_url ⇒ Object
37 38 39 40 |
# File 'lib/r_fb/configurable.rb', line 37 def app_url raise RFbAppNameUndefined if app_name.nil? "http://apps.facebook.com/#{app_name}" end |
#debug ⇒ Object
33 34 35 |
# File 'lib/r_fb/configurable.rb', line 33 def debug ENV["rfb_debug"] end |
#debug=(value) ⇒ Object
30 31 32 |
# File 'lib/r_fb/configurable.rb', line 30 def debug=(value) ENV["rfb_debug"] = value ? "1" : nil end |
#environment ⇒ Object
5 6 7 |
# File 'lib/r_fb/configurable.rb', line 5 def environment ENV["rfb_environment"] end |
#environment=(env) ⇒ Object
2 3 4 |
# File 'lib/r_fb/configurable.rb', line 2 def environment=(env) ENV["rfb_environment"] = env.to_sym end |
#secret_key ⇒ Object
19 20 21 |
# File 'lib/r_fb/configurable.rb', line 19 def secret_key ENV["rfb_secret"] end |
#secret_key=(secr) ⇒ Object
16 17 18 |
# File 'lib/r_fb/configurable.rb', line 16 def secret_key=(secr) ENV["rfb_secret"] = secr[environment.to_sym] end |