module Dhall::XML::AsDhall

Public Instance Methods

as_dhall() click to toggle source
# File lib/dhall/xml/as_dhall.rb, line 17
def as_dhall
        Dhall::Function.of_arguments(
                TYPE.type,
                TYPE.body.type,
                body: dhall_expression(Variable["_"])
        )
end
dhall_expression(var) click to toggle source
# File lib/dhall/xml/as_dhall.rb, line 10
def dhall_expression(var)
        RecordSelection.new(
                record:   var,
                selector: "text"
        ).(Text.new(value: text))
end
dhallish_attributes() click to toggle source
# File lib/dhall/xml/as_dhall.rb, line 45
def dhallish_attributes
        List.of(*attributes.to_a.map do |(attr, val)|
                { mapKey: attr.to_s, mapValue: val.to_s }.as_dhall
        end, type: Types::MAP_ENTRY())
end
dhallish_children() click to toggle source
# File lib/dhall/xml/as_dhall.rb, line 51
def dhallish_children
        List.of(*children.map do |c|
                c.dhall_expression(Variable["_"])
        end, type: Variable["_", 1])
end