Sha256: b9d51e4af5fa503ca995a8a81940cdad981d90ce5bc4508092106438cf92f86c
Contents?: true
Size: 650 Bytes
Versions: 5
Compression:
Stored size: 650 Bytes
Contents
module Typhoeus class Response def redirection? (300...399).include?( @code ) end # # 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