Class: Stats
Instance Attribute Summary collapse
-
#failed ⇒ Object
Returns the value of attribute failed.
-
#passed ⇒ Object
Returns the value of attribute passed.
-
#passed_with_warnings ⇒ Object
Returns the value of attribute passed_with_warnings.
-
#unknown ⇒ Object
Returns the value of attribute unknown.
Class Method Summary collapse
Instance Method Summary collapse
- #done? ⇒ Boolean
- #pending ⇒ Object
- #resolved ⇒ Object
- #started? ⇒ Boolean
- #submitted ⇒ Object
- #to_h(&key) ⇒ Object
- #total ⇒ Object
Instance Attribute Details
#failed ⇒ Object
Returns the value of attribute failed.
4 5 6 |
# File 'app/models/stats.rb', line 4 def failed @failed end |
#passed ⇒ Object
Returns the value of attribute passed.
4 5 6 |
# File 'app/models/stats.rb', line 4 def passed @passed end |
#passed_with_warnings ⇒ Object
Returns the value of attribute passed_with_warnings.
4 5 6 |
# File 'app/models/stats.rb', line 4 def passed_with_warnings @passed_with_warnings end |
#unknown ⇒ Object
Returns the value of attribute unknown.
4 5 6 |
# File 'app/models/stats.rb', line 4 def unknown @unknown end |
Class Method Details
Instance Method Details
#done? ⇒ Boolean
22 23 24 |
# File 'app/models/stats.rb', line 22 def done? pending == 0 end |
#pending ⇒ Object
14 15 16 |
# File 'app/models/stats.rb', line 14 def pending failed + unknown end |
#resolved ⇒ Object
18 19 20 |
# File 'app/models/stats.rb', line 18 def resolved passed + passed_with_warnings end |
#started? ⇒ Boolean
26 27 28 |
# File 'app/models/stats.rb', line 26 def started? submitted > 0 end |
#submitted ⇒ Object
10 11 12 |
# File 'app/models/stats.rb', line 10 def submitted failed + resolved end |
#to_h(&key) ⇒ Object
30 31 32 33 34 35 |
# File 'app/models/stats.rb', line 30 def to_h(&key) {key.call(:passed) => passed, key.call(:passed_with_warnings) => passed_with_warnings, key.call(:failed) => failed, key.call(:unknown) => unknown} end |
#total ⇒ Object
6 7 8 |
# File 'app/models/stats.rb', line 6 def total submitted + unknown end |