Class: TJSON::DataType::Integer

Inherits:
Scalar show all
Defined in:
lib/tjson/datatype/integer.rb

Overview

Base class of integer types

Direct Known Subclasses

SignedInt, UnsignedInt

Constant Summary

Constants inherited from TJSON::DataType

TAGS

Instance Method Summary collapse

Methods inherited from Scalar

#inspect, #scalar?

Methods inherited from TJSON::DataType

[], generate, identify_type, parse

Instance Method Details

#generate(int) ⇒ Object



7
8
9
10
# File 'lib/tjson/datatype/integer.rb', line 7

def generate(int)
  # Integers are serialized as strings to sidestep the limits of some JSON parsers
  int.to_s
end