Class: Reading::Config
Overview
Builds a singleton hash config.
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
Class Method Summary collapse
-
.build(custom_config = {}) ⇒ Hash
Builds an entire config hash from a custom config hash (which is typically not an entire config, but it can be, in which case a copy is returned).
- .hash ⇒ Hash
Instance Method Summary collapse
-
#initialize(custom_config = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(custom_config = {}) ⇒ Config
Returns a new instance of Config.
26 27 28 29 30 |
# File 'lib/reading/config.rb', line 26 def initialize(custom_config = {}) @custom_config = custom_config build_hash end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
9 10 11 |
# File 'lib/reading/config.rb', line 9 def hash @hash end |
Class Method Details
.build(custom_config = {}) ⇒ Hash
Builds an entire config hash from a custom config hash (which is typically not an entire config, but it can be, in which case a copy is returned).
15 16 17 |
# File 'lib/reading/config.rb', line 15 def self.build(custom_config = {}) @hash = new(custom_config).hash end |