Class: Checkable::Checker
- Inherits:
-
Object
- Object
- Checkable::Checker
- Defined in:
- lib/checkable.rb
Instance Attribute Summary collapse
-
#focus ⇒ Object
Returns the value of attribute focus.
-
#reports ⇒ Object
Returns the value of attribute reports.
Instance Method Summary collapse
- #check(object) ⇒ Object
-
#initialize(focus = NoFocus) ⇒ Checker
constructor
A new instance of Checker.
Constructor Details
#initialize(focus = NoFocus) ⇒ Checker
Returns a new instance of Checker.
51 52 53 54 |
# File 'lib/checkable.rb', line 51 def initialize focus=NoFocus @focus = focus @reports = [] end |
Instance Attribute Details
#focus ⇒ Object
Returns the value of attribute focus.
49 50 51 |
# File 'lib/checkable.rb', line 49 def focus @focus end |
#reports ⇒ Object
Returns the value of attribute reports.
49 50 51 |
# File 'lib/checkable.rb', line 49 def reports @reports end |
Instance Method Details
#check(object) ⇒ Object
56 57 58 59 60 61 62 63 |
# File 'lib/checkable.rb', line 56 def check object report = Report.new object checks = Checkable.checks_for object.class.name checks.each { |check| report.run check if @focus.enabled?(check) } @reports << report end |