Module: Roda::RodaPlugins::MailProcessor::RequestMethods

Defined in:
lib/roda/plugins/mail_processor.rb

Instance Method Summary collapse

Instance Method Details

#handle(&block) ⇒ Object

Mark the mail as having been handled, so routing will not call unhandled_mail implicitly.



500
501
502
503
# File 'lib/roda/plugins/mail_processor.rb', line 500

def handle(&block)
  env['roda.mail_handled'] = true
  always(&block)
end

#handle_header(key, value = nil) ⇒ Object

Same as header, but also mark the message as being handled.



485
486
487
488
489
490
491
# File 'lib/roda/plugins/mail_processor.rb', line 485

def handle_header(key, value=nil)
  header(key, value) do |*args|
    handle do
      yield(*args)
    end
  end
end

#header(key, value = nil, &block) ⇒ Object

Match based on a mail header value.



494
495
496
# File 'lib/roda/plugins/mail_processor.rb', line 494

def header(key, value=nil, &block)
  on(:header=>[key, value], &block)
end