Class: Mailflow::Attachment
- Inherits:
-
Object
- Object
- Mailflow::Attachment
- Defined in:
- lib/mailflow/attachment.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Attachment
constructor
A new instance of Attachment.
Constructor Details
#initialize(attributes) ⇒ Attachment
Returns a new instance of Attachment.
7 8 9 10 11 12 13 |
# File 'lib/mailflow/attachment.rb', line 7 def initialize(attributes) @filename = attributes['filename'] @content_type = attributes['content_type'] @size = attributes['size'] @hash = attributes['hash'] @data = Base64.decode64(attributes['data']) end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
5 6 7 |
# File 'lib/mailflow/attachment.rb', line 5 def content_type @content_type end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/mailflow/attachment.rb', line 5 def data @data end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
5 6 7 |
# File 'lib/mailflow/attachment.rb', line 5 def filename @filename end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
5 6 7 |
# File 'lib/mailflow/attachment.rb', line 5 def hash @hash end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
5 6 7 |
# File 'lib/mailflow/attachment.rb', line 5 def size @size end |