lib/arachni/page.rb in arachni-0.4.5.2 vs lib/arachni/page.rb in arachni-0.4.6
- old
+ new
@@ -1,7 +1,7 @@
=begin
- Copyright 2010-2013 Tasos Laskos <tasos.laskos@gmail.com>
+ Copyright 2010-2014 Tasos Laskos <tasos.laskos@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@@ -144,12 +144,12 @@
def document
@document ||= Nokogiri::HTML( @body )
end
def marshal_dump
- @document = nil
instance_variables.inject( {} ) do |h, iv|
+ next h if iv == :@document
h[iv] = instance_variable_get( iv )
h
end
end
@@ -169,12 +169,11 @@
end
# @return [Hash] Converts the page data to a hash.
def to_h
instance_variables.reduce({}) do |h, iv|
- if iv != :@document
- h[iv.to_s.gsub( '@', '').to_sym] = try_dup( instance_variable_get( iv ) )
- end
+ next h if iv == :@document
+ h[iv.to_s.gsub( '@', '').to_sym] = try_dup( instance_variable_get( iv ) )
h
end
end
alias :to_hash :to_h