Class: Simmer::Judge::Result
- Inherits:
-
Object
- Object
- Simmer::Judge::Result
- Defined in:
- lib/simmer/judge/result.rb
Overview
The return object of a Judge#assert call.
Instance Attribute Summary collapse
-
#bad_assertions ⇒ Object
readonly
Returns the value of attribute bad_assertions.
Instance Method Summary collapse
-
#initialize(bad_assertions = []) ⇒ Result
constructor
A new instance of Result.
- #pass? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(bad_assertions = []) ⇒ Result
Returns a new instance of Result.
16 17 18 19 20 |
# File 'lib/simmer/judge/result.rb', line 16 def initialize(bad_assertions = []) @bad_assertions = bad_assertions freeze end |
Instance Attribute Details
#bad_assertions ⇒ Object (readonly)
Returns the value of attribute bad_assertions.
14 15 16 |
# File 'lib/simmer/judge/result.rb', line 14 def bad_assertions @bad_assertions end |
Instance Method Details
#pass? ⇒ Boolean
22 23 24 |
# File 'lib/simmer/judge/result.rb', line 22 def pass? bad_assertions.empty? end |
#to_h ⇒ Object
26 27 28 29 30 31 |
# File 'lib/simmer/judge/result.rb', line 26 def to_h { 'pass' => pass?, 'bad_assertions' => bad_assertions.map(&:to_h) } end |