class Hocon::Impl::SubstitutionExpression

Attributes

optional[R]
path[R]

Public Class Methods

new(path, optional) click to toggle source
# File lib/hocon/impl/substitution_expression.rb, line 6
def initialize(path, optional)
  @path = path
  @optional = optional
end

Public Instance Methods

==(other) click to toggle source
# File lib/hocon/impl/substitution_expression.rb, line 24
def ==(other)
  if other.is_a? Hocon::Impl::SubstitutionExpression
    other.path == @path && other.optional == @optional
  else
    false
  end
end
change_path(new_path) click to toggle source
# File lib/hocon/impl/substitution_expression.rb, line 12
def change_path(new_path)
  if new_path == @path
    self
  else
    Hocon::Impl::SubstitutionExpression.new(new_path, @optional)
  end
end
hash() click to toggle source
# File lib/hocon/impl/substitution_expression.rb, line 32
def hash
  h = 41 * (41 + @path.hash)
  h = 41 * (h + (optional ? 1 : 0))

  h
end
to_s() click to toggle source
# File lib/hocon/impl/substitution_expression.rb, line 20
def to_s
  "${#{@optional ? "?" : ""}#{@path.render}}"
end