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 =
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 10
Any style scalar, the emitter chooses
0 -
DOUBLE_QUOTED =
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 19
Double quoted style
3 -
FOLDED =
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 25
Folded style
5 -
LITERAL =
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 22
Literal style
4 -
PLAIN =
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 13
Plain scalar style
1 -
SINGLE_QUOTED =
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 16
Single quoted style
2
Class Method Summary
-
.new(value, anchor = nil, tag = nil, plain = true, quoted = false, style = ANY) ⇒ Scalar
constructor
Create a new
Scalarobject.
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?
- #scalar? ⇒ Boolean readonly
-
#style
rw
The style of this scalar.
-
#tag
rw
The tag value (if there is one).
-
#value
rw
The scalar value.
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(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 31
attr_accessor :anchor
#plain (rw)
Is this a plain scalar?
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 37
attr_accessor :plain
#quoted (rw)
Is this scalar quoted?
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 40
attr_accessor :quoted
#scalar? ⇒ Boolean (readonly)
[ GitHub ]
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 67
def scalar?; true; end
#style (rw)
The style of this scalar
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 43
attr_accessor :style
#tag (rw)
The tag value (if there is one)
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 34
attr_accessor :tag
#value (rw)
The scalar value
# File 'ext/psych/lib/psych/nodes/scalar.rb', line 28
attr_accessor :value