Class: Yalphabetize::Aliaser
- Inherits:
-
Object
- Object
- Yalphabetize::Aliaser
- Defined in:
- lib/yalphabetize/aliaser.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(stream_node) ⇒ Aliaser
constructor
A new instance of Aliaser.
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
#call ⇒ Object
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 |