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

Methods inherited from TJSON::DataType

[], #decode, encode, identify_type, parse, #tag

Instance Method Details

#encode(int) ⇒ Object



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

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