Class: Checkable::Report

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#failingObject

Returns the value of attribute failing.



31
32
33
# File 'lib/checkable.rb', line 31

def failing
  @failing
end

#objectObject

Returns the value of attribute object.



31
32
33
# File 'lib/checkable.rb', line 31

def object
  @object
end

#passingObject

Returns the value of attribute passing.



31
32
33
# File 'lib/checkable.rb', line 31

def passing
  @passing
end

Instance Method Details

#ok?Boolean

Returns:

  • (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