Sha256: ffe659ef1ed2b9a5dd83f69037c66ccdabde4e3d564c801e10032df006403270

Contents?: true

Size: 604 Bytes

Versions: 7

Compression:

Stored size: 604 Bytes

Contents

module Mail
  module Jdec
    module AddressFieldPatch
      def parse(val = value)
        super
      rescue Mail::Field::ParseError => e
        if Jdec.enabled?
          @errors = [name, val, e]
          @address_list = AddressList.new('')
        else
          raise e
        end
      end

      def errors
        @errors
      end
    end
  end
end

klasses = ObjectSpace.each_object(Class).select { |klass| klass < Mail::CommonAddress }
klasses.each do |klass|
  unless klass.included_modules.include?(Mail::Jdec::AddressFieldPatch)
    klass.prepend Mail::Jdec::AddressFieldPatch
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mail-jdec-1.0.10 lib/mail/jdec/fields/address_field_patch.rb
mail-jdec-1.0.9 lib/mail/jdec/fields/address_field_patch.rb
mail-jdec-1.0.8 lib/mail/jdec/fields/address_field_patch.rb
mail-jdec-1.0.7 lib/mail/jdec/fields/address_field_patch.rb
mail-jdec-1.0.6 lib/mail/jdec/fields/address_field_patch.rb
mail-jdec-1.0.5 lib/mail/jdec/fields/address_field_patch.rb
mail-jdec-1.0.4 lib/mail/jdec/fields/address_field_patch.rb