class Pansophy::Helpers::PathBuilder
Public Class Methods
new(file, directory)
click to toggle source
# File lib/pansophy/helpers/path_builder.rb, line 4 def initialize(file, directory) @file = file @directory = directory end
Public Instance Methods
relative_path()
click to toggle source
# File lib/pansophy/helpers/path_builder.rb, line 9 def relative_path return @file.pathname if @directory.pathname.to_s.empty? @file.pathname.sub(::File.join(@directory.pathname, '/'), '') end