Class: EbisuConnection::Config
- Inherits:
-
Object
- Object
- EbisuConnection::Config
- Includes:
- Enumerable
- Defined in:
- lib/ebisu_connection/config.rb
Class Attribute Summary collapse
-
.replica_file ⇒ Object
writeonly
Sets the attribute replica_file.
Class Method Summary collapse
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(spec_name) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(spec_name) ⇒ Config
Returns a new instance of Config.
31 32 33 |
# File 'lib/ebisu_connection/config.rb', line 31 def initialize(spec_name) @conf = load_config(spec_name) end |
Class Attribute Details
.replica_file=(value) ⇒ Object
Sets the attribute replica_file
8 9 10 |
# File 'lib/ebisu_connection/config.rb', line 8 def replica_file=(value) @replica_file = value end |
Class Method Details
.config ⇒ Object
10 11 12 13 14 15 |
# File 'lib/ebisu_connection/config.rb', line 10 def config return @config if defined?(@config) conf = YAML.load_file(replica_file) @config = conf[EbisuConnection.env.to_s] || {} end |
Instance Method Details
#each(&block) ⇒ Object
35 36 37 |
# File 'lib/ebisu_connection/config.rb', line 35 def each(&block) @conf.each(&block) end |