Class: LHS::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/lhs/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.


10
11
12
13
14
15
16
# File 'lib/lhs/config.rb', line 10

def initialize
  self.request_cycle_cache_enabled ||= true
  self.trace ||= false
  if defined?(ActiveSupport::Cache::MemoryStore)
    self.request_cycle_cache ||= ActiveSupport::Cache::MemoryStore.new
  end
end

Instance Attribute Details

#request_cycle_cacheObject

Returns the value of attribute request_cycle_cache


8
9
10
# File 'lib/lhs/config.rb', line 8

def request_cycle_cache
  @request_cycle_cache
end

#request_cycle_cache_enabledObject

Returns the value of attribute request_cycle_cache_enabled


8
9
10
# File 'lib/lhs/config.rb', line 8

def request_cycle_cache_enabled
  @request_cycle_cache_enabled
end

#traceObject

Returns the value of attribute trace


8
9
10
# File 'lib/lhs/config.rb', line 8

def trace
  @trace
end

Instance Method Details

#resetObject


18
19
20
21
22
23
# File 'lib/lhs/config.rb', line 18

def reset
  self.request_cycle_cache_enabled = nil
  self.trace = nil
  self.request_cycle_cache = nil
  initialize
end