Method: Mailgun::MessageBuilder#add_attachment
- Defined in:
- lib/mailgun/messages/message_builder.rb
#add_attachment(attachment, filename = nil) ⇒ void
This method returns an undefined value.
Adds a series of attachments, when called upon.
92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/mailgun/messages/message_builder.rb', line 92 def (, filename=nil) if .is_a?(String) = File.open(, "r") end if !.is_a?(File) || !.respond_to?(:read) raise ParameterError.new("Unable to access attachment file object.") end if !filename.nil? .instance_eval "def original_filename; '#{filename}'; end" end complex_setter(:attachment, ) end |