Exception: Dry::Files::MissingTargetError

Inherits:
Error
  • Object
show all
Defined in:
lib/dry/files/error.rb

Overview

File manipulations error. Raised when the given ‘target` cannot be found in `path`.

Since:

  • 0.1.0

Instance Method Summary collapse

Constructor Details

#initialize(target, path) ⇒ Dry::Files::MissingTargetError

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the new error.

Parameters:

  • target (String, Regexp)

    the missing target

  • path (String, Pathname)

    the file

Since:

  • 0.1.0



56
57
58
59
60
61
# File 'lib/dry/files/error.rb', line 56

def initialize(target, path)
  super("cannot find `#{target}' in `#{path}'")

  @_target = target
  @_path = path
end

Instance Method Details

#pathString, Pathname

The missing target

Returns:

  • (String, Pathname)

    the file

Since:

  • 0.1.0



79
80
81
# File 'lib/dry/files/error.rb', line 79

def path
  @_path
end

#targetString, Regexp

The missing target

Returns:

  • (String, Regexp)

    the missing target

Since:

  • 0.1.0



69
70
71
# File 'lib/dry/files/error.rb', line 69

def target
  @_target
end