Sha256: a7d5ccff0dcb9bf48df47b7a098ba44fd9215b810b2e0d3395a3383928bde584

Contents?: true

Size: 553 Bytes

Versions: 1

Compression:

Stored size: 553 Bytes

Contents

class FreezingEmail::Config
  class << self
    @@defaults = {
      store_path: "freezed_emails"
    }

    def [](key)
      raise FreezingEmail::ConfigEntryNotFound unless key_exists?(key) || defaults_exists?(key)

      if key_exists?(key)
        @config[key]
      else
        @@defaults[key]
      end
    end

    def key_exists?(key)
      @config && @config.has_key?(key)
    end

    def defaults_exists?(key)
      @@defaults.has_key?(key)
    end


    def []=(key, value)
      @config ||= {}
      @config[key] = value
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
freezing_email-0.0.2 lib/freezing_email/config.rb