Class: Checkable::Report
- Inherits:
-
Object
- Object
- Checkable::Report
- Defined in:
- lib/checkable.rb
Instance Attribute Summary collapse
-
#failing ⇒ Object
Returns the value of attribute failing.
-
#object ⇒ Object
Returns the value of attribute object.
-
#passing ⇒ Object
Returns the value of attribute passing.
Instance Method Summary collapse
-
#initialize(object) ⇒ Report
constructor
A new instance of Report.
- #ok? ⇒ Boolean
- #run(check) ⇒ Object
Constructor Details
#initialize(object) ⇒ Report
Returns a new instance of Report.
33 34 35 36 37 |
# File 'lib/checkable.rb', line 33 def initialize object @object = object @passing = [] @failing = [] end |
Instance Attribute Details
#failing ⇒ Object
Returns the value of attribute failing.
31 32 33 |
# File 'lib/checkable.rb', line 31 def failing @failing end |
#object ⇒ Object
Returns the value of attribute object.
31 32 33 |
# File 'lib/checkable.rb', line 31 def object @object end |
#passing ⇒ Object
Returns the value of attribute passing.
31 32 33 |
# File 'lib/checkable.rb', line 31 def passing @passing end |
Instance Method Details
#ok? ⇒ Boolean
43 44 45 |
# File 'lib/checkable.rb', line 43 def ok? (passing.size > 0) && (failing.size == 0) end |
#run(check) ⇒ Object
39 40 41 |
# File 'lib/checkable.rb', line 39 def run check (check.check(object) ? passing : failing) << check end |