Class: Lesmok::Config
- Inherits:
-
Object
- Object
- Lesmok::Config
- Defined in:
- lib/lesmok/config.rb
Instance Attribute Summary collapse
-
#available_cache_stores ⇒ Object
Returns the value of attribute available_cache_stores.
-
#cache ⇒ Object
Returns the value of attribute cache.
-
#caching_enabled ⇒ Object
Returns the value of attribute caching_enabled.
-
#debugging_enabled ⇒ Object
(also: #debugging?)
Returns the value of attribute debugging_enabled.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#raise_errors_enabled ⇒ Object
(also: #raise_errors?)
Returns the value of attribute raise_errors_enabled.
Instance Method Summary collapse
Instance Attribute Details
#available_cache_stores ⇒ Object
Returns the value of attribute available_cache_stores.
6 7 8 |
# File 'lib/lesmok/config.rb', line 6 def available_cache_stores @available_cache_stores end |
#cache ⇒ Object
Returns the value of attribute cache.
4 5 6 |
# File 'lib/lesmok/config.rb', line 4 def cache @cache end |
#caching_enabled ⇒ Object
Returns the value of attribute caching_enabled.
5 6 7 |
# File 'lib/lesmok/config.rb', line 5 def caching_enabled @caching_enabled end |
#debugging_enabled ⇒ Object Also known as: debugging?
Returns the value of attribute debugging_enabled.
7 8 9 |
# File 'lib/lesmok/config.rb', line 7 def debugging_enabled @debugging_enabled end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/lesmok/config.rb', line 3 def logger @logger end |
#raise_errors_enabled ⇒ Object Also known as: raise_errors?
Returns the value of attribute raise_errors_enabled.
8 9 10 |
# File 'lib/lesmok/config.rb', line 8 def raise_errors_enabled @raise_errors_enabled end |
Instance Method Details
#caching? ⇒ Boolean
21 22 23 24 |
# File 'lib/lesmok/config.rb', line 21 def caching? return false if !@caching_enabled @caching_enabled.kind_of?(Proc) ? @caching_enabled.call : true end |
#find_cache_store(name = nil) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/lesmok/config.rb', line 26 def find_cache_store(name = nil) name ||= :default avail_stores = (available_cache_stores || {}) store = avail_stores[name.to_sym] store ||= avail_stores[:default] store ||= cache end |
#rails? ⇒ Boolean
34 35 36 |
# File 'lib/lesmok/config.rb', line 34 def rails? Object.const_defined? "Rails" end |