Class: Astrotrain::Mapping::HttpPost

Inherits:
Transport
  • Object
show all
Defined in:
lib/astrotrain/mapping/http_post.rb

Instance Attribute Summary

Attributes inherited from Transport

#mapping, #message

Instance Method Summary collapse

Methods inherited from Transport

inherited, #initialize, process

Constructor Details

This class inherits a constructor from Astrotrain::Mapping::Transport

Instance Method Details

#fieldsObject



9
10
11
12
13
14
15
# File 'lib/astrotrain/mapping/http_post.rb', line 9

def fields
  super
  @message.attachments.each_with_index do |att, index|
    @fields[:"attachments_#{index}"] = att
  end
  @fields
end

#processObject



4
5
6
7
# File 'lib/astrotrain/mapping/http_post.rb', line 4

def process
  return unless Transport.processing
  RestClient.post @mapping.destination, fields.merge(:emails => fields[:emails].join(","))
end