Class: DevSuite::Utils::PathMatcher::Pattern

Inherits:
Object
  • Object
show all
Defined in:
lib/dev_suite/utils/path_matcher/pattern.rb

Instance Method Summary collapse

Constructor Details

#initialize(pattern) ⇒ Pattern

Returns a new instance of Pattern.



7
8
9
# File 'lib/dev_suite/utils/path_matcher/pattern.rb', line 7

def initialize(pattern)
  @regex = convert_to_regex(pattern)
end

Instance Method Details

#match?(path) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/dev_suite/utils/path_matcher/pattern.rb', line 11

def match?(path)
  !!(@regex =~ path)
end