Class: Apache::RedirectMatchPermanent

Inherits:
MatchableThing show all
Includes:
RegularExpressionMatcher
Defined in:
lib/apache/rewrites.rb

Overview

A permanent RedirectMatch

Instance Attribute Summary

Attributes inherited from MatchableThing

#from, #to

Instance Method Summary collapse

Methods included from RegularExpressionMatcher

#match?, #test

Methods inherited from MatchableThing

#forbidden?, #from_tester, #initialize, #stop_if_match?, #to_a

Constructor Details

This class inherits a constructor from Apache::MatchableThing

Instance Method Details

#require_regexp?Boolean

Returns:

  • (Boolean)


339
# File 'lib/apache/rewrites.rb', line 339

def require_regexp?; true; end

#rule(from, to) ⇒ Object

Define a RedirectMatch rule.



326
327
328
329
330
# File 'lib/apache/rewrites.rb', line 326

def rule(from, to)
  super(from, to)

  raise "from must be a Regexp" if !from.kind_of?(Regexp)
end

#stop_if_matchObject

Stop rewrite testing if this object matches.



338
# File 'lib/apache/rewrites.rb', line 338

def stop_if_match; true; end

#tagObject

The Apache directive for this object.



323
# File 'lib/apache/rewrites.rb', line 323

def tag; 'RedirectMatch permanent'; end

#to_sObject

Convert this tag to a String.



333
334
335
# File 'lib/apache/rewrites.rb', line 333

def to_s
  "#{tag} #{[@from.source, @to].quoteize.compact.flatten * " "}"
end