Class: Protege::Gateway::Mail::Attachment

Inherits:
Data
  • Object
show all
Defined in:
lib/protege/gateway/mail/attachment.rb

Overview

Value object for a file as a mail attachment — the typed payload Outbound turns into a MIME part. It is the one shape the send path speaks: a filename, a content type, and the raw bytes on the wire. Both a reattached stored file (+Protege::StoredFile#to_mail_attachment+) and any freshly produced bytes become one of these, so the payload is defined in a single place rather than passed around as an anonymous Hash (mirroring how ::Mail is confined to Outbound).

These bytes are for transport only; the file's durable identity remains its blob, which the outbound message attaches by reference on persistence.

Instance Attribute Summary collapse

Instance Attribute Details

#bytesObject (readonly)

Returns the value of attribute bytes

Returns:

  • (Object)

    the current value of bytes



14
15
16
# File 'lib/protege/gateway/mail/attachment.rb', line 14

def bytes
  @bytes
end

#content_typeObject (readonly)

Returns the value of attribute content_type

Returns:

  • (Object)

    the current value of content_type



14
15
16
# File 'lib/protege/gateway/mail/attachment.rb', line 14

def content_type
  @content_type
end

#filenameObject (readonly)

Returns the value of attribute filename

Returns:

  • (Object)

    the current value of filename



14
15
16
# File 'lib/protege/gateway/mail/attachment.rb', line 14

def filename
  @filename
end