Class: TestResults
- Inherits:
-
Object
- Object
- TestResults
- Defined in:
- lib/zfben_hanoi/test_results.rb
Instance Attribute Summary collapse
-
#failed ⇒ Object
readonly
Returns the value of attribute failed.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#passed ⇒ Object
readonly
Returns the value of attribute passed.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(query, filename) ⇒ TestResults
constructor
A new instance of TestResults.
- #to_s ⇒ Object
Constructor Details
#initialize(query, filename) ⇒ TestResults
Returns a new instance of TestResults.
3 4 5 6 7 8 |
# File 'lib/zfben_hanoi/test_results.rb', line 3 def initialize(query, filename) @total = query['total'].to_i @passed = query['passed'].to_i @failed = query['failed'].to_i @filename = filename end |
Instance Attribute Details
#failed ⇒ Object (readonly)
Returns the value of attribute failed.
2 3 4 |
# File 'lib/zfben_hanoi/test_results.rb', line 2 def failed @failed end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
2 3 4 |
# File 'lib/zfben_hanoi/test_results.rb', line 2 def filename @filename end |
#passed ⇒ Object (readonly)
Returns the value of attribute passed.
2 3 4 |
# File 'lib/zfben_hanoi/test_results.rb', line 2 def passed @passed end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
2 3 4 |
# File 'lib/zfben_hanoi/test_results.rb', line 2 def total @total end |
Instance Method Details
#failed? ⇒ Boolean
10 11 12 |
# File 'lib/zfben_hanoi/test_results.rb', line 10 def failed? @failed > 0 end |
#to_s ⇒ Object
14 15 16 17 |
# File 'lib/zfben_hanoi/test_results.rb', line 14 def to_s return "F" if failed? "." end |