Class: HTTP::Response::Parser::Handler Private

Inherits:
LLHttp::Delegate
  • Object
show all
Defined in:
lib/http/response/parser.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(target) ⇒ Handler

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Handler.



83
84
85
86
87
# File 'lib/http/response/parser.rb', line 83

def initialize(target)
  @target = target
  super()
  reset
end

Instance Method Details

#on_body(body) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



110
111
112
# File 'lib/http/response/parser.rb', line 110

def on_body(body)
  @target.add_body(body)
end

#on_header_field(field) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



95
96
97
98
# File 'lib/http/response/parser.rb', line 95

def on_header_field(field)
  append_header if @reading_header_value
  @field << field
end

#on_header_value(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



100
101
102
103
# File 'lib/http/response/parser.rb', line 100

def on_header_value(value)
  @reading_header_value = true
  @field_value << value
end

#on_headers_completeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



105
106
107
108
# File 'lib/http/response/parser.rb', line 105

def on_headers_complete
  append_header if @reading_header_value
  @target.mark_header_finished
end

#on_message_completeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



114
115
116
# File 'lib/http/response/parser.rb', line 114

def on_message_complete
  @target.mark_message_finished
end

#resetObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



89
90
91
92
93
# File 'lib/http/response/parser.rb', line 89

def reset
  @reading_header_value = false
  @field_value = +""
  @field = +""
end