Class: LooseErbs::Graph

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/loose_erbs.rb

Defined Under Namespace

Classes: LooseVisitor, Node, Printer

Instance Method Summary collapse

Constructor Details

#initialize(keys, registry) ⇒ Graph

Returns a new instance of Graph.



178
179
180
181
182
183
# File 'lib/loose_erbs.rb', line 178

def initialize(keys, registry)
  @node_map = keys.to_h { [_1, Node.new(_1)] }
  @registry = registry

  each { process(_1) }
end

Instance Method Details

#each(&block) ⇒ Object



185
186
187
# File 'lib/loose_erbs.rb', line 185

def each(&block)
  nodes.each(&block)
end