Class: MIME::CompositeMedia::Body
- Inherits:
-
Object
- Object
- MIME::CompositeMedia::Body
- Defined in:
- lib/mime/composite_media.rb
Instance Method Summary collapse
-
#add(entity) ⇒ Object
Add
entity
to the composite body. -
#initialize(boundary) ⇒ Body
constructor
Create new composite body.
-
#to_s ⇒ Object
Format the CompositeMedia object as a MIME message.
Constructor Details
#initialize(boundary) ⇒ Body
Create new composite body.
22 23 24 25 |
# File 'lib/mime/composite_media.rb', line 22 def initialize boundary @boundary = boundary @body = Array.new end |
Instance Method Details
#add(entity) ⇒ Object
Add entity
to the composite body.
38 39 40 |
# File 'lib/mime/composite_media.rb', line 38 def add entity @body.push(entity) end |
#to_s ⇒ Object
Format the CompositeMedia object as a MIME message.
30 31 32 33 |
# 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 |