Method: Mail::Body#split!
- Defined in:
- lib/mail/body.rb
#split!(boundary) ⇒ Object
264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/mail/body.rb', line 264 def split!(boundary) self.boundary = boundary parts = extract_parts # Make the preamble equal to the preamble (if any) self.preamble = parts[0].to_s.strip # Make the epilogue equal to the epilogue (if any) self.epilogue = parts[-1].to_s.strip parts[1...-1].to_a.each { |part| @parts << Mail::Part.new(part) } self end |