Module: Astrotrain
- Defined in:
- lib/astrotrain.rb,
lib/astrotrain/message.rb,
lib/astrotrain/attachment.rb,
lib/astrotrain/transports/resque.rb,
lib/astrotrain/transports/http_post.rb
Defined Under Namespace
Modules: Transports Classes: Attachment, Message
Constant Summary collapse
- VERSION =
'0.7.0'
Class Method Summary collapse
-
.deliver(message, destination, options = {}) ⇒ Object
Processes an Astrotrain message.
Class Method Details
.deliver(message, destination, options = {}) ⇒ Object
Processes an Astrotrain message.
message - Astrotrain::Message instance. destination - String URL to deliver the message. The scheme selects
which Transport module to use (http://, resque://)
options - Optional hash of options:
:recipient - The main String recipient of the email.
:payload - Optional hash to be sent with the request.
Returns nothing.
21 22 23 24 25 26 27 |
# File 'lib/astrotrain.rb', line 21 def self.deliver(, destination, = {}) uri = Addressable::URI.parse(destination.to_s) klass = Transports.load(uri.scheme) klass.deliver(, destination, :recipient => [:recipient], :extra => [:payload]) end |