class Miniconfig::Config
Public Class Methods
new(data = {})
click to toggle source
# File lib/miniconfig.rb, line 16 def initialize(data = {}) build self, data end
Private Instance Methods
build(object, hash)
click to toggle source
# File lib/miniconfig.rb, line 22 def build(object, hash) if hash.is_a? Hash hash.each do |k, v| value = v.is_a?(Hash) ? Config.new(v) : v self.class.send(:attr_reader, k.to_sym) instance_variable_set :"@#{k}", value end else hash end end