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

Inherits:
Core::Watch::Callback show all
Includes:
Is::Inspectable
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

Returns a new instance of Path.



14
15
16
17
18
# File 'lib/core/watch/callbacks/path.rb', line 14

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.

Returns:

  • (Boolean)


22
23
24
# File 'lib/core/watch/callbacks/path.rb', line 22

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