public Method

Mail.disposition( default = nil )

Returns the content-disposition of the mail object, returns nil or the passed default value if given

Example:

mail = TMail::Mail.load("path_to/raw_mail_with_attachment")
mail.disposition #=> "attachment"

mail = TMail::Mail.load("path_to/plain_simple_email")
mail.disposition #=> nil
mail.disposition(false) #=> false

Source Code

# File action_mailer/vendor/tmail-1.2.2/tmail/interface.rb, line 918
def disposition( default = nil )
  if h = @header['content-disposition']
    h.disposition || default
  else
    default
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.