Class: Yalphabetize::Aliaser

Inherits:
Object
  • Object
show all
Defined in:
lib/yalphabetize/aliaser.rb

Instance Method Summary collapse

Constructor Details

#initialize(stream_node) ⇒ Aliaser

Returns a new instance of Aliaser.



5
6
7
8
# File 'lib/yalphabetize/aliaser.rb', line 5

def initialize(stream_node)
  @stream_node = stream_node
  @aliases = {}
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
# File 'lib/yalphabetize/aliaser.rb', line 10

def call
  nodes.each do |node|
    next unless node.respond_to?(:anchor) && node.anchor

    ensure_anchor_then_alias(node)
  end
  stream_node
end