Class Thrift::JSONPairContext
In: lib/thrift/protocol/json_protocol.rb
lib/thrift/protocol/json_protocol.rb
Parent: JSONContext

Context class for object member key-value pairs

Methods

escapeNum   escapeNum   new   new   read   read   write   write  

Public Class methods

[Source]

    # File lib/thrift/protocol/json_protocol.rb, line 92
92:     def initialize
93:       @first = true
94:       @colon = true
95:     end

[Source]

    # File lib/thrift/protocol/json_protocol.rb, line 92
92:     def initialize
93:       @first = true
94:       @colon = true
95:     end

Public Instance methods

Numbers must be turned into strings if they are the key part of a pair

[Source]

     # File lib/thrift/protocol/json_protocol.rb, line 119
119:     def escapeNum
120:       return @colon
121:     end

Numbers must be turned into strings if they are the key part of a pair

[Source]

     # File lib/thrift/protocol/json_protocol.rb, line 119
119:     def escapeNum
120:       return @colon
121:     end

[Source]

     # File lib/thrift/protocol/json_protocol.rb, line 107
107:     def read(reader)
108:       if (@first)
109:         @first = false
110:         @colon = true
111:       else
112:         ch = (@colon ? @@kJSONPairSeparator : @@kJSONElemSeparator)
113:         @colon = !@colon
114:         JsonProtocol::read_syntax_char(reader, ch)
115:       end
116:     end

[Source]

     # File lib/thrift/protocol/json_protocol.rb, line 107
107:     def read(reader)
108:       if (@first)
109:         @first = false
110:         @colon = true
111:       else
112:         ch = (@colon ? @@kJSONPairSeparator : @@kJSONElemSeparator)
113:         @colon = !@colon
114:         JsonProtocol::read_syntax_char(reader, ch)
115:       end
116:     end

[Source]

     # File lib/thrift/protocol/json_protocol.rb, line 97
 97:     def write(trans)
 98:       if (@first)
 99:         @first = false
100:         @colon = true
101:       else
102:         trans.write(@colon ? @@kJSONPairSeparator : @@kJSONElemSeparator)
103:         @colon = !@colon
104:       end
105:     end

[Source]

     # File lib/thrift/protocol/json_protocol.rb, line 97
 97:     def write(trans)
 98:       if (@first)
 99:         @first = false
100:         @colon = true
101:       else
102:         trans.write(@colon ? @@kJSONPairSeparator : @@kJSONElemSeparator)
103:         @colon = !@colon
104:       end
105:     end

[Validate]