Class: Incoming::Strategies::Mandrill
- Inherits:
-
Object
- Object
- Incoming::Strategies::Mandrill
- Includes:
- Incoming::Strategy
- Defined in:
- lib/incoming/strategies/mandrill.rb
Instance Attribute Summary
Attributes included from Incoming::Strategy
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(msg) ⇒ Mandrill
constructor
A new instance of Mandrill.
Methods included from Incoming::Strategy
#authenticate, included, #receive
Constructor Details
#initialize(msg) ⇒ Mandrill
Returns a new instance of Mandrill.
17 18 19 |
# File 'lib/incoming/strategies/mandrill.rb', line 17 def initialize(msg) @message = Mail.new(msg['raw_msg']) end |
Class Method Details
.receive(request) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/incoming/strategies/mandrill.rb', line 8 def self.receive(request) JSON.parse(request.params['mandrill_events']).map do |event| next unless event['event'] == 'inbound' result = super(event['msg']) yield(result) if block_given? result end.compact end |