Class: ERBLint::Utils::BlockMap
- Inherits:
-
Object
- Object
- ERBLint::Utils::BlockMap
- Defined in:
- lib/erb_lint/utils/block_map.rb
Defined Under Namespace
Classes: ConnectedErbNodes, Entry, ParseError
Instance Attribute Summary collapse
-
#connections ⇒ Object
readonly
Returns the value of attribute connections.
Instance Method Summary collapse
- #find_connected_nodes(other) ⇒ Object
-
#initialize(processed_source) ⇒ BlockMap
constructor
A new instance of BlockMap.
Constructor Details
#initialize(processed_source) ⇒ BlockMap
Returns a new instance of BlockMap.
13 14 15 16 17 18 19 |
# File 'lib/erb_lint/utils/block_map.rb', line 13 def initialize(processed_source) @processed_source = processed_source @entries = [] @connections = [] @ruby_code = "" build_map end |
Instance Attribute Details
#connections ⇒ Object (readonly)
Returns the value of attribute connections.
9 10 11 |
# File 'lib/erb_lint/utils/block_map.rb', line 9 def connections @connections end |
Instance Method Details
#find_connected_nodes(other) ⇒ Object
21 22 23 24 |
# File 'lib/erb_lint/utils/block_map.rb', line 21 def find_connected_nodes(other) connection = @connections.find { |conn| conn.include?(other) } connection&.nodes end |