Class: Typhoeus::Response

Inherits:
Object show all
Defined in:
lib/arachni/typhoeus/response.rb

Instance Method Summary collapse

Instance Method Details

#redirection?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/arachni/typhoeus/response.rb', line 5

def redirection?
    (300...399).include?( @code )
end

#to_hashHash

Converts obj to hash

Parameters:

  • obj (Object)

    instance of an object

Returns:

  • (Hash)


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/arachni/typhoeus/response.rb', line 16

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