Class Thrift::LookaheadReader
In: lib/thrift/protocol/json_protocol.rb
lib/thrift/protocol/json_protocol.rb
Parent: Object

Methods

new   new   peek   peek   read   read  

Public Class methods

[Source]

    # File lib/thrift/protocol/json_protocol.rb, line 39
39:     def initialize(trans)
40:       @trans = trans
41:       @hasData = false
42:       @data = nil
43:     end

[Source]

    # File lib/thrift/protocol/json_protocol.rb, line 39
39:     def initialize(trans)
40:       @trans = trans
41:       @hasData = false
42:       @data = nil
43:     end

Public Instance methods

[Source]

    # File lib/thrift/protocol/json_protocol.rb, line 55
55:     def peek
56:       if !@hasData
57:         @data = @trans.read(1)
58:       end
59:       @hasData = true
60:       return @data
61:     end

[Source]

    # File lib/thrift/protocol/json_protocol.rb, line 55
55:     def peek
56:       if !@hasData
57:         @data = @trans.read(1)
58:       end
59:       @hasData = true
60:       return @data
61:     end

[Source]

    # File lib/thrift/protocol/json_protocol.rb, line 45
45:     def read
46:       if @hasData
47:         @hasData = false
48:       else
49:         @data = @trans.read(1)
50:       end
51: 
52:       return @data
53:     end

[Source]

    # File lib/thrift/protocol/json_protocol.rb, line 45
45:     def read
46:       if @hasData
47:         @hasData = false
48:       else
49:         @data = @trans.read(1)
50:       end
51: 
52:       return @data
53:     end

[Validate]