Class: RBI::Rewriters::RemoveKnownDefinitions::Operation

Inherits:
Object
  • Object
show all
Defined in:
lib/rbi/rewriters/remove_known_definitions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(deleted_node:, duplicate_of:) ⇒ Operation

: (deleted_node: Node, duplicate_of: Node) -> void



131
132
133
134
# File 'lib/rbi/rewriters/remove_known_definitions.rb', line 131

def initialize(deleted_node:, duplicate_of:)
  @deleted_node = deleted_node
  @duplicate_of = duplicate_of
end

Instance Attribute Details

#deleted_nodeObject (readonly)

: Node



128
129
130
# File 'lib/rbi/rewriters/remove_known_definitions.rb', line 128

def deleted_node
  @deleted_node
end

#duplicate_ofObject (readonly)

: Node



128
129
130
# File 'lib/rbi/rewriters/remove_known_definitions.rb', line 128

def duplicate_of
  @duplicate_of
end

Instance Method Details

#to_sObject

: -> String



137
138
139
# File 'lib/rbi/rewriters/remove_known_definitions.rb', line 137

def to_s
  "Deleted #{duplicate_of} at #{deleted_node.loc} (duplicate from #{duplicate_of.loc})"
end