Class: Dhall::LetBlock

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

Instance Method Summary collapse

Instance Method Details

#as_jsonObject



1836
1837
1838
# File 'lib/dhall/ast.rb', line 1836

def as_json
	[25, *lets.flat_map(&:as_json), body.as_json]
end

#unflattenObject



1829
1830
1831
1832
1833
1834
# File 'lib/dhall/ast.rb', line 1829

def unflatten
	lets.reverse.reduce(body) do |inside, let|
		letin = LetIn.new(let: let, body: inside)
		block_given? ? (yield letin) : letin
	end
end