123456789_123456789_123456789_123456789_123456789_

Class: Psych::Nodes::Alias

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Node
Instance Chain:
self, Node, Enumerable
Inherits: Psych::Nodes::Node
Defined in: ext/psych/lib/psych/nodes/alias.rb

Overview

This class represents a YAML Alias. It points to an #anchor.

A Alias is a terminal node and may have no children.

Class Method Summary

Node - Inherited

.new

Create a new Node

Instance Attribute Summary

  • #anchor rw

    The anchor this alias links to.

Node - Inherited

#children

The children of this node.

#end_column

The column number where this node ends.

#end_line

The line number where this node ends.

#start_column

The column number where this node start.

#start_line

The line number where this node start.

#tag

An associated tag.

Instance Method Summary

Node - Inherited

#each

Iterate over each node in the tree.

#to_ruby

Convert this node to Ruby.

#to_yaml

Alias for Node#yaml.

#transform

Alias for Node#to_ruby.

#yaml

Convert this node to YAML.

Constructor Details

.new(anchor) ⇒ Alias

Create a new Alias that points to an #anchor

[ GitHub ]

  
# File 'ext/psych/lib/psych/nodes/alias.rb', line 14

def initialize anchor
  @anchor = anchor
end

Instance Attribute Details

#anchor (rw)

The anchor this alias links to

[ GitHub ]

  
# File 'ext/psych/lib/psych/nodes/alias.rb', line 11

attr_accessor :anchor