Context class for object member key-value pairs
# File lib/thrift/protocol/json_protocol.rb, line 80 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 107 def escapeNum return @colon end
# File lib/thrift/protocol/json_protocol.rb, line 95 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 85 def write(trans) if (@first) @first = false @colon = true else trans.write(@colon ? @@kJSONPairSeparator : @@kJSONElemSeparator) @colon = !@colon end end