Class: RBI::Comment

Inherits:
Node
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/rbi/model.rb

Direct Known Subclasses

BlankLine

Instance Attribute Summary collapse

Attributes inherited from Node

#loc, #parent_tree

Instance Method Summary collapse

Methods inherited from Node

#compatible_with?, #detach, #merge_with, #parent_conflict_tree, #parent_scope, #print, #replace, #satisfies_version?, #string

Constructor Details

#initialize(text, loc: nil) ⇒ Comment

Returns a new instance of Comment.



62
63
64
65
# File 'lib/rbi/model.rb', line 62

def initialize(text, loc: nil)
  super(loc: loc)
  @text = text
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



59
60
61
# File 'lib/rbi/model.rb', line 59

def text
  @text
end

Instance Method Details

#==(other) ⇒ Object



68
69
70
71
72
# File 'lib/rbi/model.rb', line 68

def ==(other)
  return false unless other.is_a?(Comment)

  text == other.text
end