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