scalar
![Moderate documentation Importance_2](https://d2vfyqvduarcvs.cloudfront.net/images/importance_2.png?1349367920)
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
scalar(value, anchor, tag, plain, quoted, style)
public
Called when a scalar value is found. The scalar may have an anchor, a tag, be implicitly plain or implicitly quoted
value is the string value of the scalar anchor is an associated anchor or nil tag is an associated tag or nil plain is a boolean value quoted is a boolean value style is an integer idicating the string style
See the constants in Psych::Nodes::Scalar for the possible values of style
Example
Here is a YAML document that exercises most of the possible ways this method can be called:
--- - !str "foo" - &anchor fun - many lines - | many newlines
The above YAML document contains a list with four strings. Here are the parameters sent to this method in the same order:
# value anchor tag plain quoted style ["foo", nil, "!str", false, false, 3 ] ["fun", "anchor", nil, true, false, 1 ] ["many lines", nil, nil, true, false, 1 ] ["many\nnewlines\n", nil, nil, false, true, 4 ]