Sha256: 060f0fb4f8e7350a3a1defeddc85bc8314bb926b6a3ed199f757d9e0e5d3118c

Contents?: true

Size: 376 Bytes

Versions: 8

Compression:

Stored size: 376 Bytes

Contents

module Asana
  module Resources
    # Internal: A helper to make response body parsing easier.
    module ResponseHelper
      def parse(response)
        data = response.body.fetch('data') do
          fail("Unexpected response body: #{response.body}")
        end
        extra = response.body.reject { |k, _| k == 'data' }
        [data, extra]
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
asana-0.6.0 lib/asana/resource_includes/response_helper.rb
asana-0.5.0 lib/asana/resource_includes/response_helper.rb
asana-0.4.0 lib/asana/resource_includes/response_helper.rb
asana-0.3.0 lib/asana/resource_includes/response_helper.rb
asana-0.2.0 lib/asana/resource_includes/response_helper.rb
openc-asana-0.1.2 lib/asana/resource_includes/response_helper.rb
asana-0.1.2 lib/asana/resource_includes/response_helper.rb
asana-0.1.1 lib/asana/resources/response_helper.rb