Class: Hashira::Smells::Lineage

Inherits:
Object
  • Object
show all
Defined in:
lib/hashira/smells/lineage.rb

Constant Summary collapse

MIXINS =
%i[include prepend].freeze
EXTENSIONS =
%i[extend].freeze
WRITERS =
%i[attr_writer attr_accessor].freeze
SETTERS =
[
  Prism::InstanceVariableWriteNode, Prism::InstanceVariableOrWriteNode,
  Prism::InstanceVariableAndWriteNode, Prism::InstanceVariableOperatorWriteNode,
  Prism::InstanceVariableTargetNode
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(types) ⇒ Lineage

Returns a new instance of Lineage.



18
19
20
# File 'lib/hashira/smells/lineage.rb', line 18

def initialize(types)
  @types = types
end

Instance Method Details

#assigned(context) ⇒ Object



22
# File 'lib/hashira/smells/lineage.rb', line 22

def assigned(context) = kin(context)&.flat_map { writes(it) }&.uniq