Class: Psych::Nodes::Mapping
Overview
This class represents a YAML Mapping.
A Psych::Nodes::Mapping node may have 0 or more children, but must have an even number of children. Here are the valid children a Psych::Nodes::Mapping node may have:
-
Psych::Nodes::Sequence
-
Psych::Nodes::Mapping
-
Psych::Nodes::Scalar
-
Psych::Nodes::Alias
Constant Summary collapse
- ANY =
Any Map Style
0
- BLOCK =
Block Map Style
1
- FLOW =
Flow Map Style
2
Instance Attribute Summary collapse
-
#anchor ⇒ Object
The optional anchor for this mapping.
-
#implicit ⇒ Object
Is this an implicit mapping?.
-
#style ⇒ Object
The style of this mapping.
-
#tag ⇒ Object
The optional tag for this mapping.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(anchor = nil, tag = nil, implicit = true, style = BLOCK) ⇒ Mapping
constructor
Create a new Psych::Nodes::Mapping object.
Methods inherited from Node
Constructor Details
#initialize(anchor = nil, tag = nil, implicit = true, style = BLOCK) ⇒ Mapping
Create a new Psych::Nodes::Mapping object.
anchor
is the anchor associated with the map or nil
. tag
is the tag associated with the map or nil
. implicit
is a boolean indicating whether or not the map was implicitly started. style
is an integer indicating the mapping style.
See Also
See also Psych::Handler#start_mapping
47 48 49 50 51 52 53 |
# File 'lib/psych/nodes/mapping.rb', line 47 def initialize anchor = nil, tag = nil, implicit = true, style = BLOCK super() @anchor = anchor @tag = tag @implicit = implicit @style = style end |
Instance Attribute Details
#anchor ⇒ Object
The optional anchor for this mapping
25 26 27 |
# File 'lib/psych/nodes/mapping.rb', line 25 def anchor @anchor end |
#implicit ⇒ Object
Is this an implicit mapping?
31 32 33 |
# File 'lib/psych/nodes/mapping.rb', line 31 def implicit @implicit end |
#style ⇒ Object
The style of this mapping
34 35 36 |
# File 'lib/psych/nodes/mapping.rb', line 34 def style @style end |
#tag ⇒ Object
The optional tag for this mapping
28 29 30 |
# File 'lib/psych/nodes/mapping.rb', line 28 def tag @tag end |