Module: Asana::Resources::ResponseHelper Private

Included in:
Collection, Resource, Resource
Defined in:
lib/asana/resource_includes/response_helper.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

A helper to make response body parsing easier.

Instance Method Summary collapse

Instance Method Details

#parse(response) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


5
6
7
8
9
10
11
# File 'lib/asana/resource_includes/response_helper.rb', line 5

def parse(response)
  data = response.body.fetch('data') do
    raise("Unexpected response body: #{response.body}")
  end
  extra = response.body.reject { |k, _| k == 'data' }
  [data, extra]
end