Class: Skunk::Generator::Html::SkunkData
- Inherits:
- 
      Object
      
        - Object
- Skunk::Generator::Html::SkunkData
 
- Defined in:
- lib/skunk/generators/html/skunk_data.rb
Overview
Data object for the HTML overview report
Instance Attribute Summary collapse
- 
  
    
      #analysed_modules_count  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute analysed_modules_count. 
- 
  
    
      #files  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute files. 
- 
  
    
      #generated_at  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute generated_at. 
- 
  
    
      #skunk_score_average  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute skunk_score_average. 
- 
  
    
      #skunk_score_total  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute skunk_score_total. 
- 
  
    
      #skunk_version  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute skunk_version. 
- 
  
    
      #worst_pathname  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute worst_pathname. 
- 
  
    
      #worst_score  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute worst_score. 
Instance Method Summary collapse
- 
  
    
      #initialize(analysed_modules)  ⇒ SkunkData 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of SkunkData. 
Constructor Details
#initialize(analysed_modules) ⇒ SkunkData
Returns a new instance of SkunkData.
| 15 16 17 18 19 20 21 22 23 24 25 26 | # File 'lib/skunk/generators/html/skunk_data.rb', line 15 def initialize(analysed_modules) @analysed_modules = analysed_modules @generated_at = Time.now.strftime("%Y-%m-%d %H:%M:%S") @skunk_version = Skunk::VERSION @analysed_modules_count = non_test_modules.count @skunk_score_total = non_test_modules.sum(&:skunk_score) @skunk_score_average = calculate_average @worst_pathname = PathTruncator.truncate(find_worst_module&.pathname) @worst_score = find_worst_module&.skunk_score @files = build_files end | 
Instance Attribute Details
#analysed_modules_count ⇒ Object (readonly)
Returns the value of attribute analysed_modules_count.
| 11 12 13 | # File 'lib/skunk/generators/html/skunk_data.rb', line 11 def analysed_modules_count @analysed_modules_count end | 
#files ⇒ Object (readonly)
Returns the value of attribute files.
| 11 12 13 | # File 'lib/skunk/generators/html/skunk_data.rb', line 11 def files @files end | 
#generated_at ⇒ Object (readonly)
Returns the value of attribute generated_at.
| 11 12 13 | # File 'lib/skunk/generators/html/skunk_data.rb', line 11 def generated_at @generated_at end | 
#skunk_score_average ⇒ Object (readonly)
Returns the value of attribute skunk_score_average.
| 11 12 13 | # File 'lib/skunk/generators/html/skunk_data.rb', line 11 def skunk_score_average @skunk_score_average end | 
#skunk_score_total ⇒ Object (readonly)
Returns the value of attribute skunk_score_total.
| 11 12 13 | # File 'lib/skunk/generators/html/skunk_data.rb', line 11 def skunk_score_total @skunk_score_total end | 
#skunk_version ⇒ Object (readonly)
Returns the value of attribute skunk_version.
| 11 12 13 | # File 'lib/skunk/generators/html/skunk_data.rb', line 11 def skunk_version @skunk_version end | 
#worst_pathname ⇒ Object (readonly)
Returns the value of attribute worst_pathname.
| 11 12 13 | # File 'lib/skunk/generators/html/skunk_data.rb', line 11 def worst_pathname @worst_pathname end | 
#worst_score ⇒ Object (readonly)
Returns the value of attribute worst_score.
| 11 12 13 | # File 'lib/skunk/generators/html/skunk_data.rb', line 11 def worst_score @worst_score end |