Class: Groonga::Client::Protocol::HTTP::Coolio::GroongaHTTPClient
- Inherits:
-
Coolio::HttpClient
- Object
- Coolio::HttpClient
- Groonga::Client::Protocol::HTTP::Coolio::GroongaHTTPClient
- 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.
41 42 43 44 45 46 |
# File 'lib/groonga/client/protocol/http/coolio.rb', line 41 def initialize(socket, callback) super(socket) @body = "" @callback = callback @finished = false end |
Instance Method Details
#finished? ⇒ Boolean
48 49 50 |
# File 'lib/groonga/client/protocol/http/coolio.rb', line 48 def finished? @finished end |
#on_body_data(data) ⇒ Object
52 53 54 |
# File 'lib/groonga/client/protocol/http/coolio.rb', line 52 def on_body_data(data) @body << data end |
#on_close ⇒ Object
60 61 62 63 |
# File 'lib/groonga/client/protocol/http/coolio.rb', line 60 def on_close super @finished = true end |
#on_request_complete ⇒ Object
56 57 58 |
# File 'lib/groonga/client/protocol/http/coolio.rb', line 56 def on_request_complete @callback.call(@body) end |