Module: Clustr::Config
- Defined in:
- lib/clustr/config.rb,
lib/clustr/config/clusters.rb
Overview
Note:
This module should be accessed from within a static context.
Controls all configuration settings for the Clustr gem.
Defined Under Namespace
Classes: Clusters
Class Method Summary collapse
-
.[](key) ⇒ Mixed, Nil
Accesses Config as an array of key-based values.
-
.[]=(key, value) ⇒ Mixed
Sets or modifies a key and value within the current configuration state.
-
.delete!(*keys) ⇒ Hash
Removes a key from the current configuration state.
-
.select(*args) ⇒ Hash
Retrieves values for the provided keys.
Class Method Details
.[](key) ⇒ Mixed, Nil
Accesses Clustr::Config as an array of key-based values.
40 41 42 |
# File 'lib/clustr/config.rb', line 40 def self.[](key) @@_[key.to_sym] end |
.[]=(key, value) ⇒ Mixed
Sets or modifies a key and value within the current configuration state.
52 53 54 |
# File 'lib/clustr/config.rb', line 52 def self.[]=(key,value) @@_[key.to_sym] = value end |
.delete!(*keys) ⇒ Hash
Removes a key from the current configuration state.
63 64 65 |
# File 'lib/clustr/config.rb', line 63 def self.delete!(*keys) keys.each { |k| @@_.delete(k.to_sym) } end |
.select(*args) ⇒ Hash
Note:
Keys not present within the configuration will be omitted from the returned hash.
Retrieves values for the provided keys.
27 28 29 |
# File 'lib/clustr/config.rb', line 27 def self.select(*args) @@_.select { |key| args.include?(key) } end |