Class: ROM::HTTP::Handlers::JSONResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/rom/http/handlers/json.rb

Overview

Default handler for JSON responses

Class Method Summary collapse

Class Method Details

.call(response, dataset) ⇒ Array<Hash>

Handle JSON responses

Parameters:

  • response (Net::HTTP::Response)
  • dataset (Dataset)

Returns:

  • (Array<Hash>)


59
60
61
# File 'lib/rom/http/handlers/json.rb', line 59

def self.call(response, dataset)
  Array([JSON.parse(response.body)]).flatten(1)
end