Sha256: c221b81bd3732a0e6c555c13eabbc65261859c6dbdd93f3aec1ebb9064bf795e
Contents?: true
Size: 698 Bytes
Versions: 54
Compression:
Stored size: 698 Bytes
Contents
# frozen-string-literal: true # class Roda module RodaPlugins # The r plugin adds an +r+ instance method that will return the request. # This allows you to use common Roda idioms such as +r.halt+ and # +r.redirect+ even when +r+ isn't a local variable in scope. Example: # # plugin :r # # def foo # r.redirect "/bar" # end # # route do |r| # r.get "foo" do # foo # end # r.get "bar" do # "bar" # end # end module R module InstanceMethods # The request object. def r @_request end end end register_plugin(:r, R) end end
Version data entries
54 entries across 54 versions & 1 rubygems