Class: Fit::Counts
- Inherits:
-
Object
- Object
- Fit::Counts
- Defined in:
- lib/fit/fixture.rb
Instance Attribute Summary collapse
-
#exceptions ⇒ Object
Returns the value of attribute exceptions.
-
#ignores ⇒ Object
Returns the value of attribute ignores.
-
#right ⇒ Object
Returns the value of attribute right.
-
#wrong ⇒ Object
Returns the value of attribute wrong.
Instance Method Summary collapse
-
#initialize ⇒ Counts
constructor
A new instance of Counts.
- #tally(c) ⇒ Object
- #to_s ⇒ Object
- #total_errors ⇒ Object
Constructor Details
#initialize ⇒ Counts
Returns a new instance of Counts.
35 36 37 |
# File 'lib/fit/fixture.rb', line 35 def initialize @right, @wrong, @ignores, @exceptions = 0, 0, 0, 0 end |
Instance Attribute Details
#exceptions ⇒ Object
Returns the value of attribute exceptions.
34 35 36 |
# File 'lib/fit/fixture.rb', line 34 def exceptions @exceptions end |
#ignores ⇒ Object
Returns the value of attribute ignores.
34 35 36 |
# File 'lib/fit/fixture.rb', line 34 def ignores @ignores end |
#right ⇒ Object
Returns the value of attribute right.
34 35 36 |
# File 'lib/fit/fixture.rb', line 34 def right @right end |
#wrong ⇒ Object
Returns the value of attribute wrong.
34 35 36 |
# File 'lib/fit/fixture.rb', line 34 def wrong @wrong end |
Instance Method Details
#tally(c) ⇒ Object
41 42 43 44 45 46 |
# File 'lib/fit/fixture.rb', line 41 def tally c @right += c.right @wrong += c.wrong @ignores += c.ignores @exceptions += c.exceptions end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/fit/fixture.rb', line 38 def to_s "#@right right, #@wrong wrong, #@ignores ignored, #@exceptions exceptions" end |
#total_errors ⇒ Object
47 48 49 |
# File 'lib/fit/fixture.rb', line 47 def total_errors @wrong + @exceptions end |