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
#children, #end_column, #end_line, #start_column, #start_line
Instance Method Summary collapse
-
#initialize(anchor = nil, tag = nil, implicit = true, style = BLOCK) ⇒ Mapping
constructor
Create a new Psych::Nodes::Mapping object.
- #mapping? ⇒ Boolean
Methods inherited from Node
#alias?, #document?, #each, #scalar?, #sequence?, #stream?, #to_ruby, #yaml
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
48 49 50 51 52 53 54 |
# File 'lib/psych/nodes/mapping.rb', line 48 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
26 27 28 |
# File 'lib/psych/nodes/mapping.rb', line 26 def anchor @anchor end |
#implicit ⇒ Object
Is this an implicit mapping?
32 33 34 |
# File 'lib/psych/nodes/mapping.rb', line 32 def implicit @implicit end |
#style ⇒ Object
The style of this mapping
35 36 37 |
# File 'lib/psych/nodes/mapping.rb', line 35 def style @style end |
#tag ⇒ Object
The optional tag for this mapping
29 30 31 |
# File 'lib/psych/nodes/mapping.rb', line 29 def tag @tag end |
Instance Method Details
#mapping? ⇒ Boolean
56 |
# File 'lib/psych/nodes/mapping.rb', line 56 def mapping?; true; end |