Class: Skunk::Generator::Html::FileData

Inherits:
Object
  • Object
show all
Defined in:
lib/skunk/generators/html/file_data.rb

Overview

Data object for individual file information in the HTML overview report

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(module_data) ⇒ FileData

Returns a new instance of FileData.



10
11
12
13
14
15
16
17
# File 'lib/skunk/generators/html/file_data.rb', line 10

def initialize(module_data)
  @file = PathTruncator.truncate(module_data.pathname)
  @skunk_score = module_data.skunk_score
  @churn_times_cost = module_data.churn_times_cost
  @churn = module_data.churn
  @cost = module_data.cost.round(2)
  @coverage = module_data.coverage.round(2)
end

Instance Attribute Details

#churnObject (readonly)

Returns the value of attribute churn.



8
9
10
# File 'lib/skunk/generators/html/file_data.rb', line 8

def churn
  @churn
end

#churn_times_costObject (readonly)

Returns the value of attribute churn_times_cost.



8
9
10
# File 'lib/skunk/generators/html/file_data.rb', line 8

def churn_times_cost
  @churn_times_cost
end

#costObject (readonly)

Returns the value of attribute cost.



8
9
10
# File 'lib/skunk/generators/html/file_data.rb', line 8

def cost
  @cost
end

#coverageObject (readonly)

Returns the value of attribute coverage.



8
9
10
# File 'lib/skunk/generators/html/file_data.rb', line 8

def coverage
  @coverage
end

#fileObject (readonly)

Returns the value of attribute file.



8
9
10
# File 'lib/skunk/generators/html/file_data.rb', line 8

def file
  @file
end

#skunk_scoreObject (readonly)

Returns the value of attribute skunk_score.



8
9
10
# File 'lib/skunk/generators/html/file_data.rb', line 8

def skunk_score
  @skunk_score
end