Class: Groonga::Client::Protocol::HTTP::Coolio::GroongaHTTPClient
- Inherits:
-
Coolio::HttpClient
- Object
- Coolio::HttpClient
- Groonga::Client::Protocol::HTTP::Coolio::GroongaHTTPClient
- Includes:
- PathResolvable
- Defined in:
- lib/groonga/client/protocol/http/coolio.rb
Instance Method Summary collapse
- #finished? ⇒ Boolean
-
#initialize(socket, callback) ⇒ GroongaHTTPClient
constructor
A new instance of GroongaHTTPClient.
- #on_body_data(data) ⇒ Object
- #on_close ⇒ Object
- #on_request_complete ⇒ Object
Constructor Details
#initialize(socket, callback) ⇒ GroongaHTTPClient
Returns a new instance of GroongaHTTPClient.
44 45 46 47 48 49 |
# File 'lib/groonga/client/protocol/http/coolio.rb', line 44 def initialize(socket, callback) super(socket) @body = "" @callback = callback @finished = false end |
Instance Method Details
#finished? ⇒ Boolean
51 52 53 |
# File 'lib/groonga/client/protocol/http/coolio.rb', line 51 def finished? @finished end |
#on_body_data(data) ⇒ Object
55 56 57 |
# File 'lib/groonga/client/protocol/http/coolio.rb', line 55 def on_body_data(data) @body << data end |
#on_close ⇒ Object
63 64 65 66 |
# File 'lib/groonga/client/protocol/http/coolio.rb', line 63 def on_close super @finished = true end |
#on_request_complete ⇒ Object
59 60 61 |
# File 'lib/groonga/client/protocol/http/coolio.rb', line 59 def on_request_complete @callback.call(@body) end |