Class: Watchr::FlogReportMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/watchr/metrics/flog/method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(clazz, name, score, location) ⇒ FlogReportMethod

Returns a new instance of FlogReportMethod.



5
6
7
8
9
10
11
# File 'lib/watchr/metrics/flog/method.rb', line 5

def initialize(clazz, name, score, location)
  @clazz = clazz
  @full_name = name
  @method_name = name.split(/#|::/).last
  @total_score = (10 * score).round / 10.0
  @location = location
end

Instance Attribute Details

#clazzObject (readonly)

Returns the value of attribute clazz.



3
4
5
# File 'lib/watchr/metrics/flog/method.rb', line 3

def clazz
  @clazz
end

#locationObject (readonly)

Returns the value of attribute location.



3
4
5
# File 'lib/watchr/metrics/flog/method.rb', line 3

def location
  @location
end

#total_scoreObject (readonly)

Returns the value of attribute total_score.



3
4
5
# File 'lib/watchr/metrics/flog/method.rb', line 3

def total_score
  @total_score
end

Instance Method Details

#full_nameObject Also known as: name



13
14
15
# File 'lib/watchr/metrics/flog/method.rb', line 13

def full_name
  @full_name
end

#method_nameObject



17
18
19
# File 'lib/watchr/metrics/flog/method.rb', line 17

def method_name
  @method_name
end