Class: Core::Watch::Callbacks::Path

Inherits:
Core::Watch::Callback show all
Defined in:
lib/core/watch/callbacks/path.rb

Overview

public

Callback that wraps a path.

Instance Method Summary collapse

Methods inherited from Core::Watch::Callback

build, #call

Constructor Details

#initialize(value, **kwargs, &block) ⇒ Path



11
12
13
14
15
# File 'lib/core/watch/callbacks/path.rb', line 11

def initialize(value, **kwargs, &block)
  super(**kwargs, &block)

  @path = Pathname(value.to_s)
end

Instance Method Details

#match?(path) ⇒ Boolean

public

Return ‘true` if this callback matches the path.



19
20
21
# File 'lib/core/watch/callbacks/path.rb', line 19

def match?(path)
  @path == path
end