class TJSON::DataType::Float

Floating point type

Public Instance Methods

decode(float) click to toggle source
# File lib/tjson/datatype/float.rb, line 11
def decode(float)
  raise TJSON::TypeError, "not a floating point value: #{float.inspect}" unless float.is_a?(::Numeric)
  float.to_f
end
encode(float) click to toggle source
# File lib/tjson/datatype/float.rb, line 16
def encode(float)
  float.to_f
end
tag() click to toggle source
# File lib/tjson/datatype/float.rb, line 7
def tag
  "f"
end