module Roda::RodaPlugins::Mailer::RequestMethods

  1. lib/roda/plugins/mailer.rb

Methods

Public Instance

  1. mail

Public Instance methods

mail(*args)

Similar to routing tree methods such as get and post, this matches only if the request method is MAIL (only set when using the Roda class mail or sendmail methods) and the rest of the arguments match the request. This yields any of the captures to the block, as well as any arguments passed to the mail or sendmail Roda class methods.

[show source]
    # File lib/roda/plugins/mailer.rb
169 def mail(*args)
170   if @env["REQUEST_METHOD"] == "MAIL"
171     # RODA4: Make terminal match the default
172     send(roda_class.opts[:mailer][:terminal] ? :_verb : :if_match, args) do |*vs|
173       yield(*(vs + @env['roda.mail_args']))
174     end
175   end
176 end