Class: DevSuite::Utils::PathMatcher::Pattern
- Inherits:
-
Object
- Object
- DevSuite::Utils::PathMatcher::Pattern
- Defined in:
- lib/dev_suite/utils/path_matcher/pattern.rb
Instance Method Summary collapse
-
#initialize(pattern) ⇒ Pattern
constructor
A new instance of Pattern.
- #match?(path) ⇒ Boolean
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
11 12 13 |
# File 'lib/dev_suite/utils/path_matcher/pattern.rb', line 11 def match?(path) !!(@regex =~ path) end |