Module: UserSettings

Defined in:
lib/user_settings/route_drawers/default.rb,
lib/user_settings.rb,
lib/user_settings/engine.rb,
lib/user_settings/version.rb,
app/models/user_settings/key.rb

Overview

Defined Under Namespace

Modules: RouteDrawers, UserSettingsConcern Classes: Engine, Key

Constant Summary collapse

VERSION =
"0.0.3"
@@redis_options =
false
@@redis_connection =
nil
@@base_path =
'usettings/'
@@route_drawer =
UserSettings::RouteDrawers::Default
@@expiration_time =
3.months

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (UserSettings)

    the object that the method was called on



27
28
29
# File 'lib/user_settings.rb', line 27

def self.configure
  yield self
end

.redisObject



31
32
33
34
35
36
37
38
39
# File 'lib/user_settings.rb', line 31

def self.redis
  if @@redis_options
    @@redis_connection ||= @@redis_options.delete(:redis_connection)
    if @@redis_connection == nil
      @@redis_connection ||= Redis.new({:host => 'localhost', :port => 6379, :db => 1}.merge(@@redis_options))
    end
  end
  @@redis_connection
end