Class: RBI::Comment

Inherits:
Node
  • Object
show all
Defined in:
lib/rbi/model.rb

Direct Known Subclasses

BlankLine, RBSComment

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, #rbs_print, #rbs_string, #replace, #satisfies_version?, #string

Constructor Details

#initialize(text, loc: nil) ⇒ Comment

: (String text, ?loc: Loc?) -> void



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

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

Instance Attribute Details

#textObject

: String



56
57
58
# File 'lib/rbi/model.rb', line 56

def text
  @text
end

Instance Method Details

#==(other) ⇒ Object

: (Object other) -> bool



65
66
67
68
69
# File 'lib/rbi/model.rb', line 65

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

  text == other.text
end