Class: Docscribe::CLI::Coverage::CoverageStats
- Inherits:
-
Struct
- Object
- Struct
- Docscribe::CLI::Coverage::CoverageStats
- Defined in:
- lib/docscribe/cli/coverage.rb,
lib/docscribe/cli/coverage.rb
Overview
Struct tracking documentation coverage metrics per file.
Instance Attribute Summary collapse
- #documented_methods ⇒ Integer
- #documented_params ⇒ Integer
- #documented_returns ⇒ Integer
- #total_methods ⇒ Integer
- #total_params ⇒ Integer
- #total_returns ⇒ Integer
Instance Method Summary collapse
- #method_coverage ⇒ Integer, Float
- #param_coverage ⇒ Integer, Float
- #return_coverage ⇒ Integer, Float
Instance Attribute Details
#documented_methods ⇒ Integer
43 44 45 46 47 48 |
# File 'lib/docscribe/cli/coverage.rb', line 43 CoverageStats = Struct.new( :total_methods, :documented_methods, :total_params, :documented_params, :total_returns, :documented_returns, keyword_init: true ) |
#documented_params ⇒ Integer
43 44 45 46 47 48 |
# File 'lib/docscribe/cli/coverage.rb', line 43 CoverageStats = Struct.new( :total_methods, :documented_methods, :total_params, :documented_params, :total_returns, :documented_returns, keyword_init: true ) |
#documented_returns ⇒ Integer
43 44 45 46 47 48 |
# File 'lib/docscribe/cli/coverage.rb', line 43 CoverageStats = Struct.new( :total_methods, :documented_methods, :total_params, :documented_params, :total_returns, :documented_returns, keyword_init: true ) |
#total_methods ⇒ Integer
43 44 45 46 47 48 |
# File 'lib/docscribe/cli/coverage.rb', line 43 CoverageStats = Struct.new( :total_methods, :documented_methods, :total_params, :documented_params, :total_returns, :documented_returns, keyword_init: true ) |
#total_params ⇒ Integer
43 44 45 46 47 48 |
# File 'lib/docscribe/cli/coverage.rb', line 43 CoverageStats = Struct.new( :total_methods, :documented_methods, :total_params, :documented_params, :total_returns, :documented_returns, keyword_init: true ) |
#total_returns ⇒ Integer
43 44 45 46 47 48 |
# File 'lib/docscribe/cli/coverage.rb', line 43 CoverageStats = Struct.new( :total_methods, :documented_methods, :total_params, :documented_params, :total_returns, :documented_returns, keyword_init: true ) |
Instance Method Details
#method_coverage ⇒ Integer, Float
53 54 55 |
# File 'lib/docscribe/cli/coverage.rb', line 53 def method_coverage total_methods.zero? ? 100.0 : (documented_methods.to_f / total_methods * 100).round(1) end |
#param_coverage ⇒ Integer, Float
58 59 60 |
# File 'lib/docscribe/cli/coverage.rb', line 58 def param_coverage total_params.zero? ? 100.0 : (documented_params.to_f / total_params * 100).round(1) end |
#return_coverage ⇒ Integer, Float
63 64 65 |
# File 'lib/docscribe/cli/coverage.rb', line 63 def return_coverage total_returns.zero? ? 100.0 : (documented_returns.to_f / total_returns * 100).round(1) end |