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.



497
498
499
500
# File 'lib/roda/plugins/mail_processor.rb', line 497

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.



482
483
484
485
486
487
488
# File 'lib/roda/plugins/mail_processor.rb', line 482

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.



491
492
493
# File 'lib/roda/plugins/mail_processor.rb', line 491

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