Sha256: 6d2af14190a08d1b1e14d31a82109fb1fd95db83fe28702f99e3b451181cd4d3

Contents?: true

Size: 318 Bytes

Versions: 11

Compression:

Stored size: 318 Bytes

Contents

class Grape::Batch::Response
  def self.format(status, headers, response)
    if response
      body = response.respond_to?(:body) ? response.body.join : response.join
      result = MultiJson.decode(body)
    end

    (200..299).include?(status) ? {success: result} : {code: status, error: result['error']}
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
grape-batch-2.1.0 lib/grape/batch/response.rb
grape-batch-2.0.0 lib/grape/batch/response.rb
grape-batch-1.2.1 lib/grape/batch/response.rb
grape-batch-1.2.0 lib/grape/batch/response.rb
grape-batch-1.1.4 lib/grape/batch/response.rb
grape-batch-1.1.3 lib/grape/batch/response.rb
grape-batch-1.1.2 lib/grape/batch/response.rb
grape-batch-1.1.1 lib/grape/batch/response.rb
grape-batch-1.1.0 lib/grape/batch/response.rb
grape-batch-1.0.4 lib/grape/batch/response.rb
grape-batch-1.0.3 lib/grape/batch/response.rb