Class: Stale::Configuration
- Inherits:
-
Object
- Object
- Stale::Configuration
- Includes:
- Parameters
- Defined in:
- lib/stale/configuration.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :expiration_time => 1.day, :key_prefix => 'stale:', :key_separator => ':', :model_key_separator => ':', :dependency_key_suffix => ':dependencies' }
Instance Attribute Summary collapse
-
#cache ⇒ Object
Returns the value of attribute cache.
-
#interface ⇒ Object
Returns the value of attribute interface.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Methods included from Parameters
#define_named_parameter, #key_for_parameter, #key_for_parameters, #named_parameters
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
16 17 18 19 |
# File 'lib/stale/configuration.rb', line 16 def initialize @options = DEFAULT_OPTIONS.clone @interface = Interface end |
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
13 14 15 |
# File 'lib/stale/configuration.rb', line 13 def cache @cache end |
#interface ⇒ Object
Returns the value of attribute interface.
13 14 15 |
# File 'lib/stale/configuration.rb', line 13 def interface @interface end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/stale/configuration.rb', line 14 def @options end |
Instance Method Details
#[](key) ⇒ Object
21 22 23 |
# File 'lib/stale/configuration.rb', line 21 def [](key) [key] end |
#[]=(key, value) ⇒ Object
25 26 27 |
# File 'lib/stale/configuration.rb', line 25 def []=(key, value) [key] = value end |