Class: DHS::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/dhs/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/dhs/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

#auto_oauthObject

Returns the value of attribute auto_oauth.



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

def auto_oauth
  @auto_oauth
end

#request_cycle_cacheObject

Returns the value of attribute request_cycle_cache.



8
9
10
# File 'lib/dhs/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/dhs/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/dhs/config.rb', line 8

def trace
  @trace
end

Instance Method Details

#resetObject



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

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