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
#&, #*, #+, #annotate, #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_json ⇒ Object
1100
1101
1102
|
# File 'lib/dhall/ast.rb', line 1100
def as_json
selection_syntax.as_json
end
|
1096
1097
1098
|
# File 'lib/dhall/ast.rb', line 1096
def
tag.to_sym
end
|
#normalize ⇒ Object
390
391
392
|
# File 'lib/dhall/normalize.rb', line 390
def normalize
with(alternatives: alternatives.normalize)
end
|
#reduce(handlers) ⇒ Object
1086
1087
1088
1089
1090
|
# File 'lib/dhall/ast.rb', line 1086
def reduce(handlers)
handlers = handlers.to_h
handler = handlers.fetch(tag.to_sym) { handlers.fetch(tag) }
handler
end
|
#to_s ⇒ Object
1092
1093
1094
|
# File 'lib/dhall/ast.rb', line 1092
def to_s
tag
end
|