Class: Psych::Nodes::Alias

Inherits:
Node show all
Defined in:
lib/psych/nodes/alias.rb

Overview

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

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

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #end_column, #end_line, #start_column, #start_line, #tag

Instance Method Summary collapse

Methods inherited from Node

#document?, #each, #mapping?, #scalar?, #sequence?, #stream?, #to_ruby, #yaml

Constructor Details

#initialize(anchor) ⇒ Alias

Create a new Alias that points to an anchor



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

def initialize anchor
  @anchor = anchor
end

Instance Attribute Details

#anchorObject

The anchor this alias links to



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

def anchor
  @anchor
end

Instance Method Details

#alias?Boolean

Returns:

  • (Boolean)


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

def alias?; true; end