Module: Roda::RodaPlugins::Mailer::RequestMethods
- Defined in:
- lib/roda/plugins/mailer.rb
Instance Method Summary collapse
-
#mail(*args) ⇒ Object
Similar to routing tree methods such as
getandpost, this matches only if the request method is MAIL (only set when using the Roda classmailorsendmailmethods) and the rest of the arguments match the request.
Instance Method Details
#mail(*args) ⇒ Object
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.
164 165 166 167 168 169 170 |
# File 'lib/roda/plugins/mailer.rb', line 164 def mail(*args) if @env["REQUEST_METHOD"] == "MAIL" if_match(args) do |*vs| yield(*(vs + @env['roda.mail_args'])) end end end |