class RBI::Helper

Sorbet's misc.

Attributes

name[R]

Public Class Methods

new(name, loc: nil, comments: [], &block) click to toggle source
Calls superclass method RBI::NodeWithComments::new
# File lib/rbi/model.rb, line 1183
def initialize(name, loc: nil, comments: [], &block)
  super(loc: loc, comments: comments)
  @name = name
  block&.call(self)
end

Public Instance Methods

accept_printer(v) click to toggle source
# File lib/rbi/printer.rb, line 696
def accept_printer(v)
  previous_node = v.previous_node
  v.printn if previous_node && (!previous_node.oneline? || !oneline?)

  v.printl("# #{loc}") if loc && v.print_locs
  v.visit_all(comments)
  v.printl("#{name}!")
end
compatible_with?(other) click to toggle source
# File lib/rbi/rewriters/merge_trees.rb, line 488
def compatible_with?(other)
  other.is_a?(Helper) && name == other.name
end
index_ids() click to toggle source
# File lib/rbi/index.rb, line 152
def index_ids
  [to_s]
end
to_s() click to toggle source
# File lib/rbi/model.rb, line 1190
def to_s
  "#{parent_scope&.fully_qualified_name}.#{name}!"
end