Class: Refinement::UsedPath

Inherits:
Object
  • Object
show all
Defined in:
lib/refinement/used_path.rb

Overview

Represents a path that some target depends upon.

Direct Known Subclasses

YAML

Defined Under Namespace

Classes: YAML

Instance Method Summary collapse

Constructor Details

#initialize(path:, inclusion_reason:) ⇒ UsedPath

Returns a new instance of UsedPath.



14
15
16
17
# File 'lib/refinement/used_path.rb', line 14

def initialize(path:, inclusion_reason:)
  @path = path
  @inclusion_reason = inclusion_reason
end

Instance Method Details

#find_in_changeset(changeset) ⇒ Nil, String

Returns If the path has been modified, a string explaining the modification.

Parameters:

  • changeset (Changeset)

    the changeset to search for a modification to this path

Returns:

  • (Nil, String)

    If the path has been modified, a string explaining the modification



21
22
23
# File 'lib/refinement/used_path.rb', line 21

def find_in_changeset(changeset)
  add_reason changeset.find_modification_for_path(absolute_path: path)
end