Class: McCabe::Analyzer::MethodInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/mccabe/analyzer/method_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, complexity, file, line) ⇒ MethodInfo

Returns a new instance of MethodInfo.



6
7
8
9
10
11
# File 'lib/mccabe/analyzer/method_info.rb', line 6

def initialize(name, complexity, file, line)
  @name = name
  @complexity = complexity
  @file = file
  @line = line
end

Instance Attribute Details

#complexityObject (readonly)

Returns the value of attribute complexity.



4
5
6
# File 'lib/mccabe/analyzer/method_info.rb', line 4

def complexity
  @complexity
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/mccabe/analyzer/method_info.rb', line 13

def to_s
  "#{@name} (#{@file}:#{@line}) #{@complexity}"
end