class Arachni::State::ElementFilter

Stores and provides access to the state of the {Arachni::ElementFilter}.

@author Tasos “Zapotek” Laskos <tasos.laskos@arachni-scanner.com>

Constants

TYPES

Public Class Methods

load( directory ) click to toggle source
# File lib/arachni/state/element_filter.rb, line 40
def self.load( directory )
    Marshal.load( IO.binread( "#{directory}/sets" ) )
end
new() click to toggle source
# File lib/arachni/state/element_filter.rb, line 23
def initialize
    TYPES.each do |type|
        instance_variable_set "@#{type}",
                              Support::LookUp::HashSet.new( hasher: :persistent_hash )
    end
end

Public Instance Methods

==( other ) click to toggle source
# File lib/arachni/state/element_filter.rb, line 44
def ==( other )
    hash == other.hash
end
clear() click to toggle source
# File lib/arachni/state/element_filter.rb, line 52
def clear
    TYPES.each { |type| send(type).clear }
end
dump( directory ) click to toggle source
# File lib/arachni/state/element_filter.rb, line 34
def dump( directory )
    FileUtils.mkdir_p( directory )

    IO.binwrite( "#{directory}/sets", Marshal.dump( self ) )
end
hash() click to toggle source
# File lib/arachni/state/element_filter.rb, line 48
def hash
    TYPES.map { |type| send(type).hash }.hash
end
statistics() click to toggle source
# File lib/arachni/state/element_filter.rb, line 30
def statistics
    TYPES.inject({}) { |h, type| h.merge!( type => send(type).size) }
end