Class: Mail::Part

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_postmark/mail_ext/part.rb

Instance Method Summary collapse

Instance Method Details

#to_postmarkObject



3
4
5
6
7
8
9
# File 'lib/simple_postmark/mail_ext/part.rb', line 3

def to_postmark
  {}.tap do |hash|
    hash['Content'] = attachment? ? [read].pack('m') : body.to_s
    hash['ContentType'] = mime_type
    hash['Name'] = filename
  end
end