Class: Dhall::Import::RelativePath

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, #with

Constructor Details

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

Instance Method Details

#chain_onto(relative_to) ⇒ Object



1555
1556
1557
1558
1559
# File 'lib/dhall/ast.rb', line 1555

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

#pathnameObject



1547
1548
1549
# File 'lib/dhall/ast.rb', line 1547

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

#to_sObject



1551
1552
1553
# File 'lib/dhall/ast.rb', line 1551

def to_s
	"./#{pathname}"
end