instance method
attachments
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
attachments()
No documentation comment.
Source
# File actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb, line 23
def attachments
if multipart?
parts.collect { |part|
if part.multipart?
part.attachments
elsif attachment?(part)
content = part.body # unquoted automatically by TMail#body
file_name = (part['content-location'] &&
part['content-location'].body) ||
part.sub_header("content-type", "name") ||
part.sub_header("content-disposition", "filename")
next if file_name.blank? || content.blank?
attachment = Attachment.new(content)
attachment.original_filename = file_name.strip
attachment.content_type = part.content_type
attachment
end
}.flatten.compact
end
end
Defined in actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb line 23
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in TMail::Mail