==(other)
click to toggle source
def ==(other)
other.is_a?(Comment) && other.string == string
end
concat(string:, location:)
click to toggle source
def concat(string:, location:)
@string.concat string
if loc = @location
loc.concat location
else
@location = location
end
self
end
eql?(other)
click to toggle source
hash()
click to toggle source
def hash
self.class.hash ^ string.hash
end
to_json(state = _ = nil)
click to toggle source
def to_json(state = _ = nil)
{ string: string, location: location }.to_json(state)
end