Class: Typhoeus::Response
Instance Method Summary collapse
- #redirection? ⇒ Boolean
-
#to_hash ⇒ Hash
Converts obj to hash.
Instance Method Details
#redirection? ⇒ Boolean
5 6 7 |
# File 'lib/arachni/typhoeus/response.rb', line 5 def redirection? (300...399).include?( @code ) end |
#to_hash ⇒ Hash
Converts obj to 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 |