class Cupcakinator::Config

known configuration variables method dir file root_key allow_missing

Public Class Methods

new(h={}) click to toggle source

@param [Hash] h @return Cupcakinator::Config

Calls superclass method
# File lib/cupcakinator/config.rb, line 17
def initialize(h={})
  super
  h.each_pair do |k,v|
    self[k] = v
  end
end

Public Instance Methods

to_h() click to toggle source

@return [Hash] returns uncoerced Hash

# File lib/cupcakinator/config.rb, line 26
def to_h
  convert_config_to_hash(self.dup)
end

Private Instance Methods

convert_config_to_hash(c) click to toggle source
# File lib/cupcakinator/config.rb, line 34
def convert_config_to_hash(c)
  h = Hash.new
  c.each_pair{ |key, value| Config === value ? h[key] = convert_config_to_hash(value) : h[key] = value }
  h
end