Class: HTTPX::Parser::HTTP1
- Inherits:
-
Object
- Object
- HTTPX::Parser::HTTP1
- Defined in:
- lib/httpx/parser/http1.rb,
sig/parser/http1.rbs
Constant Summary collapse
- VERSIONS =
%w[1.0 1.1].freeze
Instance Attribute Summary collapse
-
#headers ⇒ parsed_headers
readonly
Returns the value of attribute headers.
-
#http_version ⇒ String
readonly
Returns the value of attribute http_version.
-
#status_code ⇒ Integer
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
Instance Attribute Details
#headers ⇒ parsed_headers (readonly)
Returns the value of attribute headers.
10 11 12 |
# File 'lib/httpx/parser/http1.rb', line 10 def headers @headers end |
#http_version ⇒ String (readonly)
Returns the value of attribute http_version.
10 11 12 |
# File 'lib/httpx/parser/http1.rb', line 10 def http_version @http_version end |
#status_code ⇒ Integer (readonly)
Returns the value of attribute status_code.
10 11 12 |
# File 'lib/httpx/parser/http1.rb', line 10 def status_code @status_code end |
Instance Method Details
#<<(chunk) ⇒ void
This method returns an undefined value.
23 24 25 26 |
# File 'lib/httpx/parser/http1.rb', line 23 def <<(chunk) @buffer << chunk parse end |
#reset! ⇒ void
This method returns an undefined value.
28 29 30 31 32 33 34 |
# File 'lib/httpx/parser/http1.rb', line 28 def reset! @state = :idle @headers = {} @content_length = nil @_has_trailers = @upgrade = false @buffer = @buffer.to_s end |
#upgrade? ⇒ Boolean
36 37 38 |
# File 'lib/httpx/parser/http1.rb', line 36 def upgrade? @upgrade end |
#upgrade_data ⇒ String
40 41 42 |
# File 'lib/httpx/parser/http1.rb', line 40 def upgrade_data @buffer.to_s end |