Class: Tack::TestPattern

Inherits:
Regexp
  • Object
show all
Defined in:
lib/tack/test_pattern.rb

Constant Summary collapse

DEFAULT =
/.*/

Instance Method Summary collapse

Constructor Details

#initialize(pattern = nil) ⇒ TestPattern

Returns a new instance of TestPattern.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/tack/test_pattern.rb', line 7

def initialize(pattern=nil)
  pattern = case pattern
            when nil
                DEFAULT
            when String, Regexp
                pattern
            else
              DEFAULT
            end
  super(pattern)
end