Sha256: 56fbaba0c741dfc70531126cbf641007fba20b8b5d0488a7554fd814e76fa97f

Contents?: true

Size: 786 Bytes

Versions: 1

Compression:

Stored size: 786 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rabbit-hat-0.0.1 lib/hat/configurable.rb