Module: HasGlobalSession::Rails::ActionControllerClassMethods
- Defined in:
- lib/has_global_session/rails/action_controller_class_methods.rb
Overview
Module that is mixed into ActionController’s eigenclass; provides access to shared app-wide data such as the configuration object.
Instance Method Summary collapse
- #global_session_config ⇒ Object
- #global_session_config=(config) ⇒ Object
- #has_global_session ⇒ Object
Instance Method Details
#global_session_config ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/has_global_session/rails/action_controller_class_methods.rb', line 6 def global_session_config unless @global_session_config config_file = File.join(RAILS_ROOT, 'config', 'global_session.yml') @global_session_config = HasGlobalSession::Configuration.new(config_file, RAILS_ENV) @global_session_config.config_file = config_file end return @global_session_config end |
#global_session_config=(config) ⇒ Object
16 17 18 |
# File 'lib/has_global_session/rails/action_controller_class_methods.rb', line 16 def global_session_config=(config) @global_session_config = config end |
#has_global_session ⇒ Object
20 21 22 |
# File 'lib/has_global_session/rails/action_controller_class_methods.rb', line 20 def has_global_session include HasGlobalSession::Rails::ActionControllerInstanceMethods end |