Sha256: 4c7f268e535869a71222e8d022a7d6387d3f48aa1cf08823aa5ffcf6aecdaa37
Contents?: true
Size: 783 Bytes
Versions: 4
Compression:
Stored size: 783 Bytes
Contents
require "active_support/concern" module ActiveSupport module Configurable extend ActiveSupport::Concern module ClassMethods def get_config module_parts = name.split("::") modules = [Object] module_parts.each {|name| modules.push modules.last.const_get(name) } modules.reverse_each do |mod| return mod.const_get(:DEFAULT_CONFIG) if const_defined?(:DEFAULT_CONFIG) end {} end def config self.config = get_config unless @config @config end def config=(hash) @config = ActiveSupport::OrderedOptions.new hash.each do |key, value| @config[key] = value end end end def config self.class.config end end end
Version data entries
4 entries across 4 versions & 1 rubygems