Class: Mail::ContentLocationElement

Inherits:
Object
  • Object
show all
Defined in:
lib/jpmobile/mail.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#initialize_with_jpmobile(string) ⇒ Object Also known as: initialize


601
602
603
604
605
606
607
608
609
# File 'lib/jpmobile/mail.rb', line 601

def initialize_with_jpmobile(string)
  if m = string.match(/\A(.*?)(name|filename)=("|')(.+)("|')(.*?)\z/) and
      m[4].each_byte.detect { |b| (b == 0 || b > 127)}
    name = [m[4]].pack('m').strip
    string = "#{m[1]}#{m[2]}=#{m[3]}#{name}#{m[5]}#{m[6]}"
  end

  initialize_without_jpmobile(string)
end