Class: PipeRocket::MailMessage

Inherits:
Entity
  • Object
show all
Defined in:
lib/pipe_rocket/mail_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#assign_custom_fields, #transform_field_name

Constructor Details

#initialize(hash) ⇒ MailMessage

Returns a new instance of MailMessage.



4
5
6
7
8
9
10
11
12
13
# File 'lib/pipe_rocket/mail_message.rb', line 4

def initialize(hash)
  super(hash)
  if hash['attachments']
    @files = hash['attachments'].map do |file|
      PipeRocket::File.new(file)
    end
  else
    @files = []
  end
end

Instance Attribute Details

#filesObject

Returns the value of attribute files.



3
4
5
# File 'lib/pipe_rocket/mail_message.rb', line 3

def files
  @files
end