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

Instance Method Details

#global_session_configObject



6
7
8
9
10
11
12
13
# 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)
  end

  return @global_session_config
end

#global_session_config=(config) ⇒ Object



15
16
17
# File 'lib/has_global_session/rails/action_controller_class_methods.rb', line 15

def global_session_config=(config)
  @global_session_config = config
end

#has_global_sessionObject



19
20
21
# File 'lib/has_global_session/rails/action_controller_class_methods.rb', line 19

def has_global_session
  include HasGlobalSession::Rails::ActionControllerInstanceMethods
end