Class: Reek::SmellDetectors::UnusedPrivateMethod::Hit
- Inherits:
-
Object
- Object
- Reek::SmellDetectors::UnusedPrivateMethod::Hit
- 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
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(context) ⇒ Hit
constructor
A new instance of Hit.
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
#line ⇒ Object (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 |
#name ⇒ Object (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 |