Module: SolidCache::Store::Clusters
- Included in:
- SolidCache::Store
- Defined in:
- lib/solid_cache/store/clusters.rb
Instance Attribute Summary collapse
-
#clusters ⇒ Object
readonly
Returns the value of attribute clusters.
-
#primary_cluster ⇒ Object
readonly
Returns the value of attribute primary_cluster.
Instance Method Summary collapse
Instance Attribute Details
#clusters ⇒ Object (readonly)
Returns the value of attribute clusters.
4 5 6 |
# File 'lib/solid_cache/store/clusters.rb', line 4 def clusters @clusters end |
#primary_cluster ⇒ Object (readonly)
Returns the value of attribute primary_cluster.
4 5 6 |
# File 'lib/solid_cache/store/clusters.rb', line 4 def primary_cluster @primary_cluster end |
Instance Method Details
#initialize(options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/solid_cache/store/clusters.rb', line 6 def initialize( = {}) super() = .fetch(:clusters) { [ .fetch(:cluster, {}) ] } @clusters = .map.with_index do |, index| Cluster.new(.merge().merge(async_writes: index != 0)) end @primary_cluster = clusters.first end |
#setup! ⇒ Object
18 19 20 |
# File 'lib/solid_cache/store/clusters.rb', line 18 def setup! clusters.each(&:setup!) end |