Context class for object member key-value pairs
# File lib/thrift/protocol/json_protocol.rb, line 91 def initialize @first = true @colon = true end
Numbers must be turned into strings if they are the key part of a pair
# File lib/thrift/protocol/json_protocol.rb, line 118 def escapeNum return @colon end
# File lib/thrift/protocol/json_protocol.rb, line 106 def read(reader) if (@first) @first = false @colon = true else ch = (@colon ? @@kJSONPairSeparator : @@kJSONElemSeparator) @colon = !@colon JsonProtocol::read_syntax_char(reader, ch) end end
# File lib/thrift/protocol/json_protocol.rb, line 96 def write(trans) if (@first) @first = false @colon = true else trans.write(@colon ? @@kJSONPairSeparator : @@kJSONElemSeparator) @colon = !@colon end end