public Method

Mail.disposition_param( name, default = nil )

Returns the value of a parameter in an existing content-disposition header

Example:

mail.set_disposition("attachment", {:filename => "test.rb"})
mail['content-disposition'].to_s #=> "attachment; filename=test.rb"
mail.disposition_param("filename") #=> "test.rb"
mail.disposition_param("missing_param_key") #=> nil
mail.disposition_param("missing_param_key", false) #=> false
mail.disposition_param("missing_param_key", "Nothing to see here") #=> "Nothing to see here"

Source Code

# File action_mailer/vendor/tmail-1.2.2/tmail/interface.rb, line 961
def disposition_param( name, default = nil )
  if h = @header['content-disposition']
    h[name] || 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.