Class: Psych::Nodes::Scalar
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/scalar.rb |
Overview
This class represents a YAML Scalar.
This node type is a terminal node and should not have any children.
Constant Summary
-
ANY =
Any style scalar, the emitter chooses
0
-
DOUBLE_QUOTED =
Double quoted style
3
-
FOLDED =
Folded style
5
-
LITERAL =
Literal style
4
-
PLAIN =
Plain scalar style
1
-
SINGLE_QUOTED =
Single quoted style
2
Class Method Summary
-
.new(value, anchor = nil, tag = nil, plain = true, quoted = false, style = ANY) ⇒ Scalar
constructor
Create a new
Scalar
object.
Node - Inherited
Instance Attribute Summary
-
#anchor
rw
The anchor value (if there is one).
-
#plain
rw
Is this a plain scalar?
-
#quoted
rw
Is this scalar quoted?
-
#style
rw
The style of this scalar.
-
#tag
rw
The tag value (if there is one).
-
#value
rw
The scalar value.
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(value, anchor = nil, tag = nil, plain = true, quoted = false, style = ANY) ⇒ Scalar
Instance Attribute Details
#anchor (rw)
The anchor value (if there is one)
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 30
attr_accessor :anchor
#plain (rw)
Is this a plain scalar?
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 36
attr_accessor :plain
#quoted (rw)
Is this scalar quoted?
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 39
attr_accessor :quoted
#style (rw)
The style of this scalar
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 42
attr_accessor :style
#tag (rw)
The tag value (if there is one)
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 33
attr_accessor :tag
#value (rw)
The scalar value
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 27
attr_accessor :value