Class: Core::Watch::Callbacks::Regexp
- Inherits:
-
Core::Watch::Callback
- Object
- Core::Watch::Callback
- Core::Watch::Callbacks::Regexp
- Defined in:
- lib/core/watch/callbacks/regexp.rb
Overview
- public
-
Callback that wraps a regular expression.
Instance Method Summary collapse
-
#initialize(regexp, **kwargs, &block) ⇒ Regexp
constructor
A new instance of Regexp.
-
#match?(path) ⇒ Boolean
- public
-
Return ‘true` if this callback matches the path.
Methods inherited from Core::Watch::Callback
Constructor Details
#initialize(regexp, **kwargs, &block) ⇒ Regexp
Returns a new instance of Regexp.
9 10 11 12 13 |
# File 'lib/core/watch/callbacks/regexp.rb', line 9 def initialize(regexp, **kwargs, &block) super(**kwargs, &block) @regexp = regexp end |
Instance Method Details
#match?(path) ⇒ Boolean
- public
-
Return ‘true` if this callback matches the path.
17 18 19 |
# File 'lib/core/watch/callbacks/regexp.rb', line 17 def match?(path) @regexp.match?(path.to_s) end |