Class: Dhall::Import::RelativeToParentPath

Inherits:
Path
  • Object
show all
Defined in:
lib/dhall/ast.rb

Instance Method Summary collapse

Methods inherited from Path

#as_json, #canonical, decode, from_string, #initialize, #location, #origin, #resolve, #to_s, #with

Constructor Details

This class inherits a constructor from Dhall::Import::Path

Instance Method Details

#chain_onto(relative_to) ⇒ Object



1567
1568
1569
1570
1571
# File 'lib/dhall/ast.rb', line 1567

def chain_onto(relative_to)
	relative_to.with(
		path: relative_to.path[0..-2] + [".."] + path
	)
end

#pathnameObject



1563
1564
1565
# File 'lib/dhall/ast.rb', line 1563

def pathname
	Pathname.new("..").join(*path)
end