Sha256: 77139e678f7724ffb7db49e58f7091a9a73e31ecd1638493ca9f56f2fcb3c50c

Contents?: true

Size: 793 Bytes

Versions: 1

Compression:

Stored size: 793 Bytes

Contents

require 'faraday'

require_relative "mailstro/version"
require_relative "mailstro/configuration"
require_relative "mailstro/error"
require_relative "mailstro/resource"
require_relative "mailstro/delivery"

module Mailstro

  # Allows us to remove default behaviour during testing.
  class RealStrategy
    class << self
      def deliver(options)
        Delivery.new(options).deliver
      end
    end
  end

  class << self
    attr_accessor :configuration, :strategy
  end

  @strategy      = RealStrategy
  @configuration = Configuration.new

  def self.configure
    yield(@configuration) && @configuration.validate!
  end

  def self.deliver(options)
    @strategy.deliver(options)
  end

  def self.has_delivered?(template_name)
    TestStrategy.has_delivered?(template_name)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mailstro-0.0.9 lib/mailstro.rb