Class: Psych::Nodes::Mapping
| 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/mapping.rb |
Overview
This class represents a YAML Mapping.
A Mapping node may have 0 or more children, but must have an even number of children. Here are the valid children a Mapping node may have:
Constant Summary
-
ANY =
# File 'ext/psych/lib/psych/nodes/mapping.rb', line 17
Any Map Style
0 -
BLOCK =
# File 'ext/psych/lib/psych/nodes/mapping.rb', line 20
Block Map Style
1 -
FLOW =
# File 'ext/psych/lib/psych/nodes/mapping.rb', line 23
Flow Map Style
2
Class Method Summary
-
.new(anchor = nil, tag = nil, implicit = true, style = BLOCK) ⇒ Mapping
constructor
Create a new
Mappingobject.
Node - Inherited
Instance Attribute Summary
-
#anchor
rw
The optional anchor for this mapping.
-
#implicit
rw
Is this an implicit mapping?
- #mapping? ⇒ Boolean readonly
-
#style
rw
The style of this mapping.
-
#tag
rw
The optional tag for this mapping.
Node - Inherited
| #alias?, | |
| #children | The children of this node. |
| #document?, | |
| #end_column | The column number where this node ends. |
| #end_line | The line number where this node ends. |
| #mapping?, #scalar?, #sequence?, | |
| #start_column | The column number where this node start. |
| #start_line | The line number where this node start. |
| #stream?, | |
| #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 | |
| #transform |
|
| #yaml | Convert this node to YAML. |
Constructor Details
.new(anchor = nil, tag = nil, implicit = true, style = BLOCK) ⇒ Mapping
Create a new 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 Handler#start_mapping
Instance Attribute Details
#anchor (rw)
The optional anchor for this mapping
# File 'ext/psych/lib/psych/nodes/mapping.rb', line 26
attr_accessor :anchor
#implicit (rw)
Is this an implicit mapping?
# File 'ext/psych/lib/psych/nodes/mapping.rb', line 32
attr_accessor :implicit
#mapping? ⇒ Boolean (readonly)
[ GitHub ]
# File 'ext/psych/lib/psych/nodes/mapping.rb', line 56
def mapping?; true; end
#style (rw)
The style of this mapping
# File 'ext/psych/lib/psych/nodes/mapping.rb', line 35
attr_accessor :style
#tag (rw)
The optional tag for this mapping
# File 'ext/psych/lib/psych/nodes/mapping.rb', line 29
attr_accessor :tag