Module: Fusion::JsonInput
- Defined in:
- lib/fusion.rb
Class Method Summary collapse
- .convert(x) ⇒ Object
-
.parse(text) ⇒ Object
Parse JSON text into Fusion values (null -> NULL).
Class Method Details
.convert(x) ⇒ Object
1131 1132 1133 1134 1135 1136 1137 1138 |
# File 'lib/fusion.rb', line 1131 def self.convert(x) case x when nil then NULL when Array then x.map { |e| convert(e) } when Hash then x.each_with_object({}) { |(k, v), h| h[k] = convert(v) } else x end end |