Sha256: 6e6b31b3df58a4977f90d6d64d294eb0f24094f68401bb3268583d03ac828b8c
Contents?: true
Size: 591 Bytes
Versions: 11
Compression:
Stored size: 591 Bytes
Contents
module Koala module HTTPService class Response attr_reader :status, :body, :headers # Creates a new Response object, which standardizes the response received by Facebook for use within Koala. def initialize(status, body, headers) @status = status @body = body @headers = headers end def data # quirks_mode is needed because Facebook sometimes returns a raw true or false value -- # in Ruby 2.4 we can drop that. @data ||= JSON.parse(body, quirks_mode: true) unless body.empty? end end end end
Version data entries
11 entries across 11 versions & 1 rubygems