Sha256: bff352cfc2a58a6a3129f4ac0a1f34672a9b844d1843c561964125c99c3d2017

Contents?: true

Size: 750 Bytes

Versions: 2

Compression:

Stored size: 750 Bytes

Contents

require 'configtoolkit'
require 'configtoolkit/hashreader'
require 'configtoolkit/hashwriter'

module RCelery
  class Configuration < ConfigToolkit::BaseConfig
    add_optional_param(:host, String, 'localhost')
    add_optional_param(:port, Integer, 5672)
    add_optional_param(:vhost, String, '/')
    add_optional_param(:username, String, 'guest')
    add_optional_param(:password, String, 'guest')
    add_optional_param(:application, String, 'application')
    add_optional_param(:worker_count, Integer, 1)
    add_optional_param(:eager_mode, ConfigToolkit::Boolean, false)

    def initialize(options = {})
      load(ConfigToolkit::HashReader.new(options))
    end

    def to_hash
      dump(ConfigToolkit::HashWriter.new)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rcelery-1.0.1 lib/rcelery/configuration.rb
rcelery-1.0.0 lib/rcelery/configuration.rb