Class: SendgridNotification::Attachment
- Inherits:
-
Object
- Object
- SendgridNotification::Attachment
- Includes:
- ActiveModel::Attributes, ActiveModel::Model
- Defined in:
- app/models/sendgrid_notification/attachment.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.wrap(hash_or_attachment) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'app/models/sendgrid_notification/attachment.rb', line 28 def self.wrap() case when Attachment self else Attachment.new(**.to_h) end end |
Instance Method Details
#as_sendgrid ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/models/sendgrid_notification/attachment.rb', line 18 def as_sendgrid a = ::SendGrid::Attachment.new a.content_id = content_id a.filename = filename a.content = Base64.strict_encode64(content) a.type = mime_type a.disposition = disposition a end |