K
Karan Rajput
I have one array in ruby as,
arr= [1, 2, '5', 'one', 'two', 'three', "4,6"]
as after doing arr.to_yaml, it prints as,
---
- 1
- 2
- "5"
- one
- two
- three
- "4,6"
This is my problem. It shows "4,6" as string (double-quoted) and
(one,two) are non-quoted which itself as string. I am passing this
string to some else database program which need clear distinction
between string and integer.
I require the result set as,
---
- 1
- 2
- "5"
- "one"
- "two"
- "three"
- "4,6"
Does yaml have any provision so that i can achieve the result set in
above consistent format?
arr= [1, 2, '5', 'one', 'two', 'three', "4,6"]
as after doing arr.to_yaml, it prints as,
---
- 1
- 2
- "5"
- one
- two
- three
- "4,6"
This is my problem. It shows "4,6" as string (double-quoted) and
(one,two) are non-quoted which itself as string. I am passing this
string to some else database program which need clear distinction
between string and integer.
I require the result set as,
---
- 1
- 2
- "5"
- "one"
- "two"
- "three"
- "4,6"
Does yaml have any provision so that i can achieve the result set in
above consistent format?