Class: Dhall::Enum

Inherits:
Union show all
Defined in:
lib/dhall/ast.rb,
lib/dhall/normalize.rb

Instance Method Summary collapse

Methods inherited from Union

decode, from, #selection_syntax, #syntax

Methods inherited from Expression

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

Instance Method Details

#as_jsonObject



1051
1052
1053
# File 'lib/dhall/ast.rb', line 1051

def as_json
	selection_syntax.as_json
end

#extractObject



1047
1048
1049
# File 'lib/dhall/ast.rb', line 1047

def extract
	tag.to_sym
end

#normalizeObject



374
375
376
# File 'lib/dhall/normalize.rb', line 374

def normalize
	with(alternatives: alternatives.normalize)
end

#reduce(handlers) ⇒ Object



1037
1038
1039
1040
1041
# File 'lib/dhall/ast.rb', line 1037

def reduce(handlers)
	handlers = handlers.to_h
	handler = handlers.fetch(tag.to_sym) { handlers.fetch(tag) }
	handler
end

#to_sObject



1043
1044
1045
# File 'lib/dhall/ast.rb', line 1043

def to_s
	tag
end