class Hocon::Impl::Tokens::Comment

Attributes

text[R]

Public Class Methods

new(origin, text) click to toggle source
Calls superclass method
# File lib/hocon/impl/tokens.rb, line 198
def initialize(origin, text)
  super(TokenType::COMMENT, origin)
  @text = text
end

Public Instance Methods

==(other) click to toggle source
Calls superclass method
# File lib/hocon/impl/tokens.rb, line 237
def ==(other)
  super(other) && other.text == @text
end
can_equal(other) click to toggle source
# File lib/hocon/impl/tokens.rb, line 233
def can_equal(other)
  other.is_a?(Comment)
end
hash() click to toggle source
Calls superclass method
# File lib/hocon/impl/tokens.rb, line 241
def hash
  hashcode = 41 * (41 + super)
  hashcode = 41 * (hashcode + @text.hash)

  hashcode
end
to_s() click to toggle source
# File lib/hocon/impl/tokens.rb, line 225
def to_s
  sb = StringIO.new
  sb << "'#"
  sb << text
  sb << "' (COMMENT)"
  sb.string
end