Class: FeldtRuby::ValueArchive
- Defined in:
- lib/feldtruby/statistics/array_archive.rb
Overview
A ValueArchive keeps basic statistics about values supplied to it in array.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the number of times an array has been added to the archive.
Instance Method Summary collapse
-
#initialize ⇒ ValueArchive
constructor
A new instance of ValueArchive.
- #update(values) ⇒ Object
Constructor Details
#initialize ⇒ ValueArchive
Returns a new instance of ValueArchive.
7 8 9 |
# File 'lib/feldtruby/statistics/array_archive.rb', line 7 def initialize @count = 0 end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the number of times an array has been added to the archive.
12 13 14 |
# File 'lib/feldtruby/statistics/array_archive.rb', line 12 def count @count end |
Instance Method Details
#update(values) ⇒ Object
14 15 16 |
# File 'lib/feldtruby/statistics/array_archive.rb', line 14 def update(values) @count += 1 end |