In Files

  • rbs-1.0.4/lib/rbs/ast/comment.rb

Class/Module Index [+]

Quicksearch

RBS::AST::Comment

Attributes

location[R]
string[R]

Public Class Methods

new(string:, location:) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/ast/comment.rb, line 7
def initialize(string,, location))
  @string = string
  @location = location
end
            

Public Instance Methods

==(other) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/ast/comment.rb, line 12
def ==(other)
  other.is_a?(Comment) && other.string == string
end
            
Also aliased as: eql?
concat(string:, location:) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/ast/comment.rb, line 26
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
Alias for: ==
hash() click to toggle source
 
               # File rbs-1.0.4/lib/rbs/ast/comment.rb, line 18
def hash
  self.class.hash ^ string.hash
end
            
to_json(*a) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/ast/comment.rb, line 22
def to_json(*a)
  { string: string, location: location }.to_json(*a)
end