class MIME::Media

Abstract top-level media class.

Attributes

body[R]
headers[R]

Public Class Methods

new(content, content_type, content_params = {}) click to toggle source
# File lib/mime/media.rb, line 14
def initialize content, content_type, content_params = {}
  AbstractClassError.no_instantiation(self, Media)
  @headers  = Header.new
  @body     = content
  self.id   = ID.generate_gid
  self.type = append_field_params(content_type, content_params)
end

Public Instance Methods

to_s() click to toggle source

Format the Media object as a MIME message.

# File lib/mime/media.rb, line 25
def to_s
  "#{headers}\r\n\r\n#{body}"
end