Class: RBI::ScopeConflict

Inherits:
Tree show all
Extended by:
T::Sig
Defined in:
lib/rbi/rewriters/merge_trees.rb

Overview

A conflict between two scope headers

Is rendered as a merge conflict between ‘left` and` right` for scope definitions: ~~~rb <<<<<<< left class Foo

module Foo >>>>>>> right

def m1; end

end ~~~

Instance Attribute Summary collapse

Attributes inherited from Tree

#nodes

Attributes inherited from NodeWithComments

#comments

Attributes inherited from Node

#loc, #parent_tree

Instance Method Summary collapse

Methods inherited from Tree

#<<, #add_sig_templates!, #annotate!, #deannotate!, #empty?, #filter_versions!, #group_nodes!, #index, #merge, #nest_non_public_methods!, #nest_singleton_methods!, #replace_attributes_with_methods!, #sort_nodes!

Methods inherited from NodeWithComments

#annotations, #merge_with, #version_requirements

Methods inherited from Node

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

Constructor Details

#initialize(left:, right:, left_name: "left", right_name: "right") ⇒ ScopeConflict

Returns a new instance of ScopeConflict.



641
642
643
644
645
646
647
# File 'lib/rbi/rewriters/merge_trees.rb', line 641

def initialize(left:, right:, left_name: "left", right_name: "right")
  super()
  @left = left
  @right = right
  @left_name = left_name
  @right_name = right_name
end

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



628
629
630
# File 'lib/rbi/rewriters/merge_trees.rb', line 628

def left
  @left
end

#left_nameObject (readonly)

Returns the value of attribute left_name.



631
632
633
# File 'lib/rbi/rewriters/merge_trees.rb', line 631

def left_name
  @left_name
end

#rightObject (readonly)

Returns the value of attribute right.



628
629
630
# File 'lib/rbi/rewriters/merge_trees.rb', line 628

def right
  @right
end

#right_nameObject (readonly)

Returns the value of attribute right_name.



631
632
633
# File 'lib/rbi/rewriters/merge_trees.rb', line 631

def right_name
  @right_name
end