class Utopia::Redirection::Rewrite
Rewrite
requests that match the given pattern to a single destination.
Public Class Methods
new(app, patterns, status: 301)
click to toggle source
Calls superclass method
Utopia::Redirection::ClientRedirect::new
# File lib/utopia/redirection.rb, line 150 def initialize(app, patterns, status: 301) @patterns = patterns super(app, status: status) end
Public Instance Methods
[](path)
click to toggle source
# File lib/utopia/redirection.rb, line 156 def [] path if location = @patterns[path] return redirect(location) end end