Class: Thrift::JSONListContext
- Inherits:
-
JSONContext
- Object
- JSONContext
- Thrift::JSONListContext
- Defined in:
- lib/thrift/protocol/json_protocol.rb
Overview
Context class for lists
Instance Method Summary collapse
-
#initialize ⇒ JSONListContext
constructor
A new instance of JSONListContext.
- #read(reader) ⇒ Object
- #write(trans) ⇒ Object
Methods inherited from JSONContext
Constructor Details
#initialize ⇒ JSONListContext
Returns a new instance of JSONListContext.
127 128 129 |
# File 'lib/thrift/protocol/json_protocol.rb', line 127 def initialize @first = true end |
Instance Method Details
#read(reader) ⇒ Object
139 140 141 142 143 144 145 |
# File 'lib/thrift/protocol/json_protocol.rb', line 139 def read(reader) if (@first) @first = false else JsonProtocol::read_syntax_char(reader, @@kJSONElemSeparator) end end |
#write(trans) ⇒ Object
131 132 133 134 135 136 137 |
# File 'lib/thrift/protocol/json_protocol.rb', line 131 def write(trans) if (@first) @first = false else trans.write(@@kJSONElemSeparator) end end |