Class: Dhall::RecordProjectionByExpression

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

Instance Method Summary collapse

Methods inherited from Expression

#&, #*, #+, #annotate, #as_dhall, #cache_key, #call, #concat, decode, #deep_merge, #deep_merge_type, #dhall_eq, #digest, #fusion, #merge, #resolve, #shift, #slice, #substitute, #to_binary, #to_cbor, #to_proc, #to_s, #|

Instance Method Details

#as_jsonObject



933
934
935
# File 'lib/dhall/ast.rb', line 933

def as_json
	[10, record.as_json, [selector.as_json]]
end

#fetch(selector) ⇒ Object



929
930
931
# File 'lib/dhall/ast.rb', line 929

def fetch(selector)
	record.fetch(selector)
end

#normalizeObject



354
355
356
357
358
359
360
361
362
# File 'lib/dhall/normalize.rb', line 354

def normalize
	sel = selector.normalize

	if sel.is_a?(RecordType)
		RecordProjection.for(record, sel.keys).normalize
	else
		with(record: record.normalize, selector: sel)
	end
end