class Hocon::Impl::Tokens::Substitution
This is not a Value
, because it requires special processing
Attributes
Public Class Methods
Source
# File lib/hocon/impl/tokens.rb, line 251 def initialize(origin, optional, expression) super(TokenType::SUBSTITUTION, origin) @optional = optional @value = expression end
Calls superclass method
Public Instance Methods
Source
# File lib/hocon/impl/tokens.rb, line 281 def ==(other) super(other) && other.value == @value end
Calls superclass method
Source
# File lib/hocon/impl/tokens.rb, line 277 def can_equal(other) other.is_a?(Substitution) end
Source
# File lib/hocon/impl/tokens.rb, line 285 def hash 41 * (41 + super + @value.hash) end
Calls superclass method
Source
# File lib/hocon/impl/tokens.rb, line 269 def to_s sb = StringIO.new value.each do |t| sb << t.to_s end "'${#{sb.to_s}}'" end
Source
# File lib/hocon/impl/tokens.rb, line 263 def token_text sub_text = "" @value.each { |t| sub_text << t.token_text } "${" + (@optional ? "?" : "") + sub_text + "}" end