Class: Reek::Smells::DuplicateMethodCall::FoundCall

Inherits:
Object
  • Object
show all
Defined in:
lib/reek/smells/duplicate_method_call.rb

Overview

Collects information about a single found call

Instance Method Summary collapse

Constructor Details

#initialize(call_node) ⇒ FoundCall


63
64
65
66
# File 'lib/reek/smells/duplicate_method_call.rb', line 63

def initialize(call_node)
  @call_node = call_node
  @occurences = []
end

Instance Method Details

#callObject


72
73
74
# File 'lib/reek/smells/duplicate_method_call.rb', line 72

def call
  @call ||= @call_node.format_ruby
end

#linesObject


80
81
82
# File 'lib/reek/smells/duplicate_method_call.rb', line 80

def lines
  @occurences.map(&:line)
end

#occursObject


76
77
78
# File 'lib/reek/smells/duplicate_method_call.rb', line 76

def occurs
  @occurences.length
end

#record(occurence) ⇒ Object


68
69
70
# File 'lib/reek/smells/duplicate_method_call.rb', line 68

def record(occurence)
  @occurences.push occurence
end