class RBI::NodeWithComments
Attributes
comments[RW]
Public Class Methods
new(loc: nil, comments: [])
click to toggle source
Calls superclass method
RBI::Node::new
# File lib/rbi/model.rb, line 88 def initialize(loc: nil, comments: []) super(loc: loc) @comments = comments end
Public Instance Methods
merge_with(other)
click to toggle source
# File lib/rbi/rewriters/merge_trees.rb, line 306 def merge_with(other) return unless other.is_a?(NodeWithComments) other.comments.each do |comment| comments << comment unless comments.include?(comment) end end
oneline?()
click to toggle source
# File lib/rbi/printer.rb, line 149 def oneline? comments.empty? end