class Arachni::Support::LookUp::Moolb

Opposite of Bloom a filter, ergo Moolb.

Basically a cache used for look-up operations.

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

Constants

DEFAULT_OPTIONS

Public Class Methods

new( options = {} ) click to toggle source

@param [Hash] options @option options [Support::Cache::Base] :strategy (Support::Cache::RandomReplacement)

Sets the type of cache to use.

@option options [Integer] :max_size (100_000)

Maximum size of the cache.

@see DEFAULT_OPTIONS

Calls superclass method Arachni::Support::LookUp::Base::new
# File lib/arachni/support/lookup/moolb.rb, line 34
def initialize( options = {} )
    super( options )

    @options.merge!( DEFAULT_OPTIONS.merge( options ) )
    @collection = @options[:strategy].new( @options[:max_size] )
end

Public Instance Methods

<<( item ) click to toggle source

@param [#persistent_hash] item

Item to insert.

@return [HashSet]

`self`
# File lib/arachni/support/lookup/moolb.rb, line 46
def <<( item )
    @collection[calculate_hash( item )] = true
    self
end
Also aliased as: add
add( item )
Alias for: <<