Class: Psych::Nodes::Sequence
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/sequence.rb |
Overview
This class represents a YAML sequence.
A YAML sequence is basically a list, and looks like this:
%YAML 1.1
---
- I am
- a Sequence
A YAML sequence may have an anchor like this:
%YAML 1.1
---
&A [
"This sequence",
"has an anchor"
]
A YAML sequence may also have a tag like this:
%YAML 1.1
---
!!seq [
"This sequence",
"has a tag"
]
This class represents a sequence in a YAML document. A Sequence
node may have 0 or more children. Valid children for this node are:
Constant Summary
-
ANY =
Any Styles, emitter chooses
0
-
BLOCK =
Block style sequence
1
-
FLOW =
Flow style sequence
2
Class Method Summary
-
.new(anchor = nil, tag = nil, implicit = true, style = BLOCK) ⇒ Sequence
constructor
Create a new object representing a YAML sequence.
Node - Inherited
Instance Attribute Summary
-
#anchor
rw
The anchor for this sequence (if any).
-
#implicit
rw
Is this sequence started implicitly?
-
#style
rw
The sequence style used.
-
#tag
rw
The tag name for this sequence (if any).
Node - Inherited
Instance Method Summary
Node - Inherited
#each | Iterate over each node in the tree. |
#to_ruby | Convert this node to Ruby. |
#to_yaml | |
#transform | Alias for Node#to_ruby. |
#yaml | Convert this node to YAML. |
Constructor Details
.new(anchor = nil, tag = nil, implicit = true, style = BLOCK) ⇒ Sequence
Instance Attribute Details
#anchor (rw)
The anchor for this sequence (if any)
# File 'ext/psych/lib/psych/nodes/sequence.rb', line 51
attr_accessor :anchor
#implicit (rw)
Is this sequence started implicitly?
# File 'ext/psych/lib/psych/nodes/sequence.rb', line 57
attr_accessor :implicit
#style (rw)
The sequence style used
# File 'ext/psych/lib/psych/nodes/sequence.rb', line 60
attr_accessor :style
#tag (rw)
The tag name for this sequence (if any)
# File 'ext/psych/lib/psych/nodes/sequence.rb', line 54
attr_accessor :tag