Class: Autoproj::Stats::PackageStats
- Inherits:
-
Object
- Object
- Autoproj::Stats::PackageStats
- Defined in:
- lib/autoproj/stats/package_stats.rb
Instance Attribute Summary collapse
-
#authors ⇒ Object
readonly
Returns the value of attribute authors.
-
#copyright ⇒ Object
readonly
Returns the value of attribute copyright.
-
#sloc ⇒ Object
readonly
Returns the value of attribute sloc.
Instance Method Summary collapse
- #+(other) ⇒ Object
-
#initialize(sloc = 0, authors = Hash.new, copyright = Hash.new) ⇒ PackageStats
constructor
A new instance of PackageStats.
Constructor Details
#initialize(sloc = 0, authors = Hash.new, copyright = Hash.new) ⇒ PackageStats
Returns a new instance of PackageStats.
7 8 9 |
# File 'lib/autoproj/stats/package_stats.rb', line 7 def initialize(sloc = 0, = Hash.new, copyright = Hash.new) @sloc, @authors, @copyright = sloc, , copyright end |
Instance Attribute Details
#authors ⇒ Object (readonly)
Returns the value of attribute authors.
5 6 7 |
# File 'lib/autoproj/stats/package_stats.rb', line 5 def @authors end |
#copyright ⇒ Object (readonly)
Returns the value of attribute copyright.
6 7 8 |
# File 'lib/autoproj/stats/package_stats.rb', line 6 def copyright @copyright end |
#sloc ⇒ Object (readonly)
Returns the value of attribute sloc.
4 5 6 |
# File 'lib/autoproj/stats/package_stats.rb', line 4 def sloc @sloc end |
Instance Method Details
#+(other) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/autoproj/stats/package_stats.rb', line 11 def +(other) PackageStats.new( sloc + other.sloc, .merge(other.) { |_, v1, v2| v1 + v2 }, copyright.merge(other.copyright) { |_, v1, v2| v1 + v2 }) end |