Class: Reek::Smells::DuplicateMethodCall::FoundCall Private
- Inherits:
-
Object
- Object
- Reek::Smells::DuplicateMethodCall::FoundCall
- Defined in:
- lib/reek/smells/duplicate_method_call.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Collects information about a single found call
Instance Method Summary collapse
- #call ⇒ Object private
-
#initialize(call_node) ⇒ FoundCall
constructor
private
A new instance of FoundCall.
- #lines ⇒ Object private
- #occurs ⇒ Object private
- #record(occurence) ⇒ Object private
Constructor Details
#initialize(call_node) ⇒ FoundCall
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of FoundCall.
65 66 67 68 |
# File 'lib/reek/smells/duplicate_method_call.rb', line 65 def initialize(call_node) @call_node = call_node @occurences = [] end |
Instance Method Details
#call ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
74 75 76 |
# File 'lib/reek/smells/duplicate_method_call.rb', line 74 def call @call ||= @call_node.format_to_ruby end |
#lines ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
82 83 84 |
# File 'lib/reek/smells/duplicate_method_call.rb', line 82 def lines @occurences.map(&:line) end |
#occurs ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
78 79 80 |
# File 'lib/reek/smells/duplicate_method_call.rb', line 78 def occurs @occurences.length end |
#record(occurence) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
70 71 72 |
# File 'lib/reek/smells/duplicate_method_call.rb', line 70 def record(occurence) @occurences.push occurence end |