Sha256: cf5eb25e31cb10e214b074ab09bd358162391f4a0ae2a3e16c4f9c8d97d8f661

Contents?: true

Size: 623 Bytes

Versions: 21

Compression:

Stored size: 623 Bytes

Contents

module Spreewald
  SUPPORTED_EMAIL_HEADERS = ["To", "CC", "BCC", "From", "Reply-To", "Subject", "Attachments"]

  class UnsupportedEmailHeader < StandardError
    attr_reader :header, :value

    def initialize(header, value)
      @header, @value = header, value
      error_message = <<-MESSAGE.strip_heredoc
        It looks like you're trying to match against an unsupported header "#{header}".
        The following headers are supported: #{supported_headers_list}
      MESSAGE
      super(error_message)
    end

    private

    def supported_headers_list
      SUPPORTED_EMAIL_HEADERS.join(", ")
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
spreewald-4.6.3 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.6.2 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.6.1 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.6.0 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.5.1 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.5.0 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.4.4 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.4.3 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.4.2 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.4.1 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.4.0 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.3.6 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.3.5 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.3.4 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.3.3 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.3.2 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.2.3 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.2.2 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.1.2 lib/spreewald_support/unsupported_email_header.rb
spreewald-4.1.1 lib/spreewald_support/unsupported_email_header.rb