Class: SPDY::Parser

Inherits:
Object
  • Object
show all
Includes:
Protocol
Defined in:
lib/spdy/parser.rb

Constant Summary

Constants included from Protocol

SPDY::Protocol::CONTROL_BIT, SPDY::Protocol::DATA_BIT, SPDY::Protocol::VERSION

Instance Method Summary collapse

Constructor Details

#initializeParser

Returns a new instance of Parser.



5
6
7
# File 'lib/spdy/parser.rb', line 5

def initialize
  @buffer = ''
end

Instance Method Details

#<<(data) ⇒ Object



9
10
11
12
# File 'lib/spdy/parser.rb', line 9

def <<(data)
  @buffer << data
  try_parse
end

#on_body(&blk) ⇒ Object



18
19
20
# File 'lib/spdy/parser.rb', line 18

def on_body(&blk)
  @on_body = blk
end

#on_headers_complete(&blk) ⇒ Object



14
15
16
# File 'lib/spdy/parser.rb', line 14

def on_headers_complete(&blk)
  @on_headers_complete = blk
end

#on_message_complete(&blk) ⇒ Object



22
23
24
# File 'lib/spdy/parser.rb', line 22

def on_message_complete(&blk)
  @on_message_complete = blk
end