Method: ChupaText::Formatters::MIME#format_finish
- Defined in:
- lib/chupa-text/formatters/mime.rb
#format_finish(data) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/chupa-text/formatters/mime.rb', line 31 def format_finish(data) formatted = super @output << "MIME-Version: 1.0\r\n" format_hash(formatted, ["texts"]) texts = formatted["texts"] boundary = @boundary || Digest::SHA1.hexdigest(data.uri.to_s) @output << "Content-Type: multipart/mixed; boundary=#{boundary}\r\n" texts.each do |text| @output << "\r\n--#{boundary}\r\n" format_text(text) end @output << "\r\n--#{boundary}--\r\n" end |