module Hat def self.config @config ||= Hashie::Mash.new end module Configurable def self.included(base) base.extend ClassMethods end module ClassMethods def has_configuration(name, default={}) Hat.config[name] = Hashie::Mash.new(default) end def config Hat.config end end def config Hat.config end end include Configurable has_configuration :connection, { host: 'localhost', port: 5672 } has_configuration :exchange, { durable: false, exclusive: false } has_configuration :queue, {} end