Class: Reek::SmellDetectors::UnusedPrivateMethod::Hit

Inherits:
Object
  • Object
show all
Defined in:
lib/reek/smell_detectors/unused_private_method.rb

Overview

Class for storing ‘hits` which are unused private methods we found in the given context. `name` and `line` are then used to construct SmellWarnings.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Hit

Returns a new instance of Hit.



24
25
26
27
# File 'lib/reek/smell_detectors/unused_private_method.rb', line 24

def initialize(context)
  @name  = context.name
  @line  = context.exp.line
end

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



22
23
24
# File 'lib/reek/smell_detectors/unused_private_method.rb', line 22

def line
  @line
end

#nameObject (readonly)

Returns the value of attribute name.



22
23
24
# File 'lib/reek/smell_detectors/unused_private_method.rb', line 22

def name
  @name
end