Class: McCabe::Analyzer::MethodInfo
- Inherits:
-
Object
- Object
- McCabe::Analyzer::MethodInfo
- Defined in:
- lib/mccabe/analyzer/method_info.rb
Instance Attribute Summary collapse
-
#complexity ⇒ Object
readonly
Returns the value of attribute complexity.
Instance Method Summary collapse
-
#initialize(name, complexity, file, line) ⇒ MethodInfo
constructor
A new instance of MethodInfo.
- #to_s ⇒ Object
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
#complexity ⇒ Object (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_s ⇒ Object
13 14 15 |
# File 'lib/mccabe/analyzer/method_info.rb', line 13 def to_s "#{@name} (#{@file}:#{@line}) #{@complexity}" end |