Class: Hashira::Complexity::RescueScan
- Inherits:
-
Object
- Object
- Hashira::Complexity::RescueScan
- Defined in:
- lib/hashira/complexity/rescue_scan.rb
Instance Method Summary collapse
- #apply(node, nesting) ⇒ Object
-
#initialize(scorer) ⇒ RescueScan
constructor
A new instance of RescueScan.
Constructor Details
#initialize(scorer) ⇒ RescueScan
Returns a new instance of RescueScan.
6 7 8 |
# File 'lib/hashira/complexity/rescue_scan.rb', line 6 def initialize(scorer) @scorer = scorer end |
Instance Method Details
#apply(node, nesting) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/hashira/complexity/rescue_scan.rb', line 10 def apply(node, nesting) @scorer.visit(node.statements, nesting) clauses(node.rescue_clause, nesting) @scorer.visit(node.else_clause, nesting) @scorer.visit(node.ensure_clause, nesting) end |