Class: Typhoeus::Response
Instance Method Summary collapse
-
#to_hash ⇒ Hash
Converts obj to hash.
Instance Method Details
#to_hash ⇒ Hash
Converts obj to hash
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/typhoeus/response.rb', line 12 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 |