Class: Fit::Counts

Inherits:
Object
  • Object
show all
Defined in:
lib/fit/fixture.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCounts

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

#exceptionsObject

Returns the value of attribute exceptions.



34
35
36
# File 'lib/fit/fixture.rb', line 34

def exceptions
  @exceptions
end

#ignoresObject

Returns the value of attribute ignores.



34
35
36
# File 'lib/fit/fixture.rb', line 34

def ignores
  @ignores
end

#rightObject

Returns the value of attribute right.



34
35
36
# File 'lib/fit/fixture.rb', line 34

def right
  @right
end

#wrongObject

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_sObject



38
39
40
# File 'lib/fit/fixture.rb', line 38

def to_s
  "#@right right, #@wrong wrong, #@ignores ignored, #@exceptions exceptions"
end

#total_errorsObject



47
48
49
# File 'lib/fit/fixture.rb', line 47

def total_errors
  @wrong + @exceptions
end