class MIME::CompositeMedia::Body

Public Class Methods

new(boundary) click to toggle source

Create new composite body.

# File lib/mime/composite_media.rb, line 22
def initialize boundary
  @boundary = boundary
  @body = Array.new
end

Public Instance Methods

add(entity) click to toggle source

Add entity to the composite body.

# File lib/mime/composite_media.rb, line 38
def add entity
  @body.push(entity)
end
to_s() click to toggle source

Format the CompositeMedia object as a MIME message.

# File lib/mime/composite_media.rb, line 30
def to_s
  all_entities = @body.join("\r\n--#{@boundary}\r\n")
  "--#{@boundary}\r\n#{all_entities}\r\n--#{@boundary}--\r\n"
end