Class: J2119::Deduce
- Inherits:
-
Object
- Object
- J2119::Deduce
- Defined in:
- lib/j2119/deduce.rb
Class Method Summary collapse
-
.value(val) ⇒ Object
we have to deduce the JSON value from they way they expressed it as text in the J2119 file.
Class Method Details
.value(val) ⇒ Object
we have to deduce the JSON value from they way they expressed it as
text in the J2119 file.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/j2119/deduce.rb', line 21 def self.value(val) case val when /^"(.*)"$/ $1 when 'true' true when 'false' false when 'null' nil when /^\d+$/ val.to_i else val.to_f end end |