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
: Hash[Node, String?].
Instance Method Summary collapse
-
#initialize(context) ⇒ CollectStrictnesses
constructor
: (Context context) -> void.
-
#visit_node(node) ⇒ Object
: (FileTree::Node node) -> void.
Methods inherited from Visitor
Constructor Details
#initialize(context) ⇒ CollectStrictnesses
: (Context context) -> void
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)
: Hash[Node, String?]
137 138 139 |
# File 'lib/spoom/file_tree.rb', line 137 def strictnesses @strictnesses end |
Instance Method Details
#visit_node(node) ⇒ Object
: (FileTree::Node node) -> void
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 |