Class: Hermes::MailgunAttachment
- Inherits:
-
StringIO
- Object
- StringIO
- Hermes::MailgunAttachment
- Defined in:
- lib/providers/mailgun/mailgun_attachment.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#original_filename ⇒ Object
readonly
Returns the value of attribute original_filename.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(attachment, *rest) ⇒ MailgunAttachment
constructor
A new instance of MailgunAttachment.
Constructor Details
#initialize(attachment, *rest) ⇒ MailgunAttachment
Returns a new instance of MailgunAttachment.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/providers/mailgun/mailgun_attachment.rb', line 5 def initialize (, *rest) @path = '' if rest.detect {|opt| opt[:inline] } basename = @original_filename = .cid else basename = @original_filename = .filename end @content_type = .content_type.split(';')[0] super .body.decoded end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
3 4 5 |
# File 'lib/providers/mailgun/mailgun_attachment.rb', line 3 def content_type @content_type end |
#original_filename ⇒ Object (readonly)
Returns the value of attribute original_filename.
3 4 5 |
# File 'lib/providers/mailgun/mailgun_attachment.rb', line 3 def original_filename @original_filename end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/providers/mailgun/mailgun_attachment.rb', line 3 def path @path end |