Class: Ksql::Handlers::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/ksql/handlers/collection.rb

Class Method Summary collapse

Class Method Details

.handle(response) ⇒ Ksql::Collection

Handle the response to generate an Enumerable collection

Parameters:

Returns:



13
14
15
16
17
18
19
# File 'lib/ksql/handlers/collection.rb', line 13

def self.handle(response)
  return Ksql::Error.new(response.body) if response.error?

  body_dup = response.body
  headers = body_dup.shift
  Ksql::Collection.new(headers, body_dup)
end