Class: TestQueue::Stats
- Inherits:
-
Object
- Object
- TestQueue::Stats
- Defined in:
- lib/test_queue/stats.rb
Defined Under Namespace
Classes: Suite
Instance Method Summary collapse
- #all_suites ⇒ Object
-
#initialize(path) ⇒ Stats
constructor
A new instance of Stats.
- #record_suites(suites) ⇒ Object
- #save ⇒ Object
- #suite(name) ⇒ Object
Constructor Details
#initialize(path) ⇒ Stats
Returns a new instance of Stats.
38 39 40 41 42 |
# File 'lib/test_queue/stats.rb', line 38 def initialize(path) @path = path @suites = {} load end |
Instance Method Details
#all_suites ⇒ Object
44 45 46 |
# File 'lib/test_queue/stats.rb', line 44 def all_suites @suites.values end |
#record_suites(suites) ⇒ Object
52 53 54 55 56 |
# File 'lib/test_queue/stats.rb', line 52 def record_suites(suites) suites.each do |suite| @suites[suite.name] = suite end end |
#save ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/test_queue/stats.rb', line 58 def save prune File.open(@path, 'wb') do |f| Marshal.dump(to_h, f) end end |
#suite(name) ⇒ Object
48 49 50 |
# File 'lib/test_queue/stats.rb', line 48 def suite(name) @suites[name] end |