class Mutiny::Mutants::Storage::Path

Attributes

relative[R]
root[R]

Public Class Methods

from_absolute(path:, root:) click to toggle source
# File lib/mutiny/mutants/storage/path.rb, line 7
def self.from_absolute(path:, root:)
  relative_path = Pathname.new(path).relative_path_from(Pathname.new(root)).to_s
  new(relative_path, root)
end
from_relative(path:, root:) click to toggle source
# File lib/mutiny/mutants/storage/path.rb, line 12
def self.from_relative(path:, root:)
  new(path, root)
end
new(relative, root) click to toggle source
# File lib/mutiny/mutants/storage/path.rb, line 24
def initialize(relative, root)
  @relative = relative
  @root = root
end

Public Instance Methods

absolute() click to toggle source
# File lib/mutiny/mutants/storage/path.rb, line 18
def absolute
  File.join(root, relative)
end