class SitemapBoiler::Config

Attributes

config_hash[RW]

Public Class Methods

from_file(config_path) click to toggle source
# 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
new(config_hash) click to toggle source
# File lib/sitemap_boiler/config.rb, line 8
def initialize(config_hash)
  @config_hash = DefaultConfig.merge(config_hash)
end

Public Instance Methods

[](key) click to toggle source
# File lib/sitemap_boiler/config.rb, line 12
def [](key)
  config_hash[key.to_s]
end

Private Instance Methods

read_config(path) click to toggle source
# File lib/sitemap_boiler/config.rb, line 23
def read_config(path)
  JSON.parse File.open(path).read
end