--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Attaches a file or multiple files to an email. You call this from a method in your MailController (including a before filter).
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Parameters
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "file_or_files<File, Array[File]>:"
    body: File(s) to attach.
  type: :NOTE
- !ruby/struct:SM::Flow::P 
  body: "filename&lt;String&gt;::"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "type<~to_s>:"
    body: The attachment MIME type. If left out, it will be determined from file_or_files.
  - !ruby/struct:SM::Flow::LI 
    label: "headers<String, Array>:"
    body: Additional attachment headers.
  type: :NOTE
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  attach File.open(&quot;foo&quot;)\n  attach [File.open(&quot;foo&quot;), File.open(&quot;bar&quot;)]\n"
- !ruby/struct:SM::Flow::P 
  body: "If you are passing an array of files, you should use an array of the allowed parameters:"
- !ruby/struct:SM::Flow::VERB 
  body: "  attach [[File.open(&quot;foo&quot;), &quot;bar&quot;, &quot;text/html&quot;], [File.open(&quot;baz&quot;),\n    &quot;bat&quot;, &quot;text/css&quot;]\n\n which would attach two files (&quot;foo&quot; and &quot;baz&quot; in the filesystem) as\n"
- !ruby/struct:SM::Flow::P 
  body: "&quot;bar&quot; and &quot;bat&quot; respectively. It would also set the mime-type as &quot;text/html&quot; and &quot;text/css&quot; respectively."
full_name: Merb::MailController#attach
is_singleton: false
name: attach
params: "( file_or_files, filename = file_or_files.is_a?(File) ? File.basename(file_or_files.path) : nil, type = nil, headers = nil)"
visibility: public
