Sha256: 622afa48251a093f14a7f343429e84b1a975182e42341511e2aadb6e909e84ea

Contents?: true

Size: 479 Bytes

Versions: 1

Compression:

Stored size: 479 Bytes

Contents

module Mailstro
  class Configuration
    attr_accessor :api_endpoint
    attr_accessor :api_key
    attr_accessor :enabled

    def initialize
      @api_endpoint = 'https://api.mailstroapp.com/v1'
    end

    def enabled=(value)
      if value
        Mailstro.strategy = ProductionStrategy
      else
        Mailstro.strategy = TestStrategy
      end
    end

    def validate!
      raise Error::ConfigurationError, "api_key not provided" if api_key.nil?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mailstro-0.1.0 lib/mailstro/configuration.rb