Class: Spoom::FileTree::CollectStrictnesses
- Defined in:
- lib/spoom/file_tree.rb
Overview
A visitor that collects the strictness of each node in a tree
Direct Known Subclasses
Instance Attribute Summary collapse
- #strictnesses ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(context) ⇒ CollectStrictnesses
constructor
A new instance of CollectStrictnesses.
- #visit_node(node) ⇒ Object
Methods inherited from Visitor
Constructor Details
#initialize(context) ⇒ CollectStrictnesses
Returns a new instance of CollectStrictnesses.
140 141 142 143 144 |
# File 'lib/spoom/file_tree.rb', line 140 def initialize(context) super() @context = context @strictnesses = {} #: Hash[Node, String?] end |
Instance Attribute Details
#strictnesses ⇒ Object (readonly)
137 138 139 |
# File 'lib/spoom/file_tree.rb', line 137 def strictnesses @strictnesses end |
Instance Method Details
#visit_node(node) ⇒ Object
148 149 150 151 152 153 |
# File 'lib/spoom/file_tree.rb', line 148 def visit_node(node) path = node.path @strictnesses[node] = @context.read_file_strictness(path) if @context.file?(path) super end |