class Dhall::Import::EnvironmentVariable

Attributes

var[R]

Public Class Methods

decode(*args) click to toggle source
# File lib/dhall/binary.rb, line 254
def self.decode(*args)
        new(*args)
end
new(var) click to toggle source
# File lib/dhall/ast.rb, line 1591
def initialize(var)
        @var = var
end

Public Instance Methods

==(other)
Alias for: eql?
as_json() click to toggle source
# File lib/dhall/ast.rb, line 1647
def as_json
        @var
end
canonical() click to toggle source
# File lib/dhall/ast.rb, line 1611
def canonical
        self
end
chain_onto(relative_to) click to toggle source
# File lib/dhall/ast.rb, line 1595
def chain_onto(relative_to)
        if relative_to.is_a?(URI)
                raise ImportBannedException, "remote import cannot import #{self}"
        end

        self
end
eql?(other) click to toggle source
# File lib/dhall/ast.rb, line 1642
def eql?(other)
        other.is_a?(self.class) && other.var == var
end
Also aliased as: ==
hash() click to toggle source
# File lib/dhall/ast.rb, line 1638
def hash
        @var.hash
end
location() click to toggle source
# File lib/dhall/ast.rb, line 1634
def location
        Union.from(Location, "Environment", to_s.as_dhall)
end
origin() click to toggle source
# File lib/dhall/ast.rb, line 1623
def origin
        "localhost"
end
path() click to toggle source
# File lib/dhall/ast.rb, line 1603
def path
        []
end
real_path() click to toggle source
# File lib/dhall/ast.rb, line 1615
def real_path
        self
end
resolve(resolver) click to toggle source
# File lib/dhall/ast.rb, line 1619
def resolve(resolver)
        resolver.resolve_environment(self)
end
to_s() click to toggle source
# File lib/dhall/ast.rb, line 1627
def to_s
        escapes = Parser::PosixEnvironmentVariableCharacter::ESCAPES
        "env:#{@var.gsub(/[\"\\\a\b\f\n\r\t\v]/) do |c|
                "\\" + escapes.find { |(_, v)| v == c }.first
        end}"
end
with(path:) click to toggle source
# File lib/dhall/ast.rb, line 1607
def with(path:)
        Path.from_string(path.join("/"))
end