Class: CodeStats::Report
- Inherits:
-
Object
- Object
- CodeStats::Report
- Defined in:
- lib/code_stats.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#empty ⇒ Object
Returns the value of attribute empty.
-
#lines ⇒ Object
Returns the value of attribute lines.
Instance Method Summary collapse
- #<<(stats) ⇒ Object
- #code ⇒ Object
-
#initialize(*directories) ⇒ Report
constructor
A new instance of Report.
Constructor Details
#initialize(*directories) ⇒ Report
Returns a new instance of Report.
38 39 40 41 |
# File 'lib/code_stats.rb', line 38 def initialize(*directories) @directories = directories @lines, @comments, @empty = 0, 0, 0 end |
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments.
36 37 38 |
# File 'lib/code_stats.rb', line 36 def comments @comments end |
#empty ⇒ Object
Returns the value of attribute empty.
36 37 38 |
# File 'lib/code_stats.rb', line 36 def empty @empty end |
#lines ⇒ Object
Returns the value of attribute lines.
36 37 38 |
# File 'lib/code_stats.rb', line 36 def lines @lines end |
Instance Method Details
#<<(stats) ⇒ Object
43 44 45 46 47 |
# File 'lib/code_stats.rb', line 43 def <<(stats) @lines += stats.lines @comments += stats.comments @empty += stats.empty end |
#code ⇒ Object
49 50 51 |
# File 'lib/code_stats.rb', line 49 def code lines - comments - empty end |