Sha256: 0f2cec1c8433918ebbbbfc2cf0c9d3ae8a93856b546d7826d33d79cc91a0e52b
Contents?: true
Size: 582 Bytes
Versions: 5
Compression:
Stored size: 582 Bytes
Contents
module Typhoeus class Response # # Converts obj to hash # # @param [Object] obj instance of an object # # @return [Hash] # def to_hash hash = Hash.new instance_variables.each { |var| key = var.to_s.gsub( /@/, '' ) hash[key] = instance_variable_get( var ) } hash['headers_hash'] = {} headers_hash.each_pair { |k, v| hash['headers_hash'][k] = v } hash.delete( 'request' ) return hash end end end
Version data entries
5 entries across 5 versions & 1 rubygems