Class: Exchange::Cache::Configuration
- Inherits:
-
Exchange::Configurable
- Object
- Exchange::Configurable
- Exchange::Cache::Configuration
- Defined in:
- lib/exchange/cache/configuration.rb
Overview
A Class that handles caching configuration options
Instance Attribute Summary collapse
-
#expire ⇒ Object
Additional properties which are proprietary to the cache configuration.
-
#host ⇒ Object
Additional properties which are proprietary to the cache configuration.
-
#path ⇒ Object
Additional properties which are proprietary to the cache configuration.
-
#port ⇒ Object
Additional properties which are proprietary to the cache configuration.
Class Method Summary collapse
-
.wipe_client_before_setting(*setters) ⇒ Object
Alias method chain to set the client to nil before an attribute of the configuration is set.
Instance Method Summary collapse
-
#key ⇒ Object
The key of the configuration.
-
#parent_module ⇒ Object
The parent module to get the constants from.
-
#set(hash) ⇒ Object
Overrides the parent class method to set the client to nil before setting the configuration via a hash.
Methods inherited from Exchange::Configurable
#reset, #subclass_with_constantize
Instance Attribute Details
#expire ⇒ Object
Additional properties which are proprietary to the cache configuration
14 15 16 |
# File 'lib/exchange/cache/configuration.rb', line 14 def expire @expire end |
#host ⇒ Object
Additional properties which are proprietary to the cache configuration
14 15 16 |
# File 'lib/exchange/cache/configuration.rb', line 14 def host @host end |
#path ⇒ Object
Additional properties which are proprietary to the cache configuration
14 15 16 |
# File 'lib/exchange/cache/configuration.rb', line 14 def path @path end |
#port ⇒ Object
Additional properties which are proprietary to the cache configuration
14 15 16 |
# File 'lib/exchange/cache/configuration.rb', line 14 def port @port end |
Class Method Details
.wipe_client_before_setting(*setters) ⇒ Object
Alias method chain to set the client to nil before an attribute of the configuration is set.
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/exchange/cache/configuration.rb', line 21 def wipe_client_before_setting *setters setters.each do |setter| define_method :"#{setter}_with_client_wipe=" do |data| wipe_subclass_client! send(:"#{setter}_without_client_wipe=", data) end alias_method :"#{setter}_without_client_wipe=", :"#{setter}=" alias_method :"#{setter}=", :"#{setter}_with_client_wipe=" end end |
Instance Method Details
#key ⇒ Object
The key of the configuration
61 62 63 |
# File 'lib/exchange/cache/configuration.rb', line 61 def key :cache end |
#parent_module ⇒ Object
The parent module to get the constants from
55 56 57 |
# File 'lib/exchange/cache/configuration.rb', line 55 def parent_module Cache end |
#set(hash) ⇒ Object
Overrides the parent class method to set the client to nil before setting the configuration via a hash
47 48 49 50 |
# File 'lib/exchange/cache/configuration.rb', line 47 def set hash wipe_subclass_client! super end |