Class: SitemapBoiler::Config
- Inherits:
-
Object
- Object
- SitemapBoiler::Config
- Defined in:
- lib/sitemap_boiler/config.rb
Instance Attribute Summary collapse
-
#config_hash ⇒ Object
Returns the value of attribute config_hash.
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(config_hash) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(config_hash) ⇒ Config
Returns a new instance of Config.
8 9 10 |
# File 'lib/sitemap_boiler/config.rb', line 8 def initialize(config_hash) @config_hash = DefaultConfig.merge(config_hash) end |
Instance Attribute Details
#config_hash ⇒ Object
Returns the value of attribute config_hash.
6 7 8 |
# File 'lib/sitemap_boiler/config.rb', line 6 def config_hash @config_hash end |
Class Method Details
.from_file(config_path) ⇒ Object
16 17 18 19 |
# File 'lib/sitemap_boiler/config.rb', line 16 def self.from_file config_path config_hash = JSON.parse(File.read(config_path)) new(config_hash) end |
Instance Method Details
#[](key) ⇒ Object
12 13 14 |
# File 'lib/sitemap_boiler/config.rb', line 12 def [](key) config_hash[key.to_s] end |