Class: Arachni::State::ElementFilter
- Defined in:
- lib/arachni/state/element_filter.rb
Overview
Stores and provides access to the state of the ElementFilter.
Instance Attribute Summary collapse
- #cookies ⇒ Support::LookUp::HashSet readonly
- #forms ⇒ Support::LookUp::HashSet readonly
- #links ⇒ Support::LookUp::HashSet readonly
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #clear ⇒ Object
- #dump(directory) ⇒ Object
- #hash ⇒ Object
-
#initialize ⇒ ElementFilter
constructor
A new instance of ElementFilter.
- #statistics ⇒ Object
Constructor Details
#initialize ⇒ ElementFilter
Returns a new instance of ElementFilter.
26 27 28 29 30 |
# File 'lib/arachni/state/element_filter.rb', line 26 def initialize @forms = Support::LookUp::HashSet.new( hasher: :persistent_hash ) @links = Support::LookUp::HashSet.new( hasher: :persistent_hash ) @cookies = Support::LookUp::HashSet.new( hasher: :persistent_hash ) end |
Instance Attribute Details
#cookies ⇒ Support::LookUp::HashSet (readonly)
24 25 26 |
# File 'lib/arachni/state/element_filter.rb', line 24 def @cookies end |
#forms ⇒ Support::LookUp::HashSet (readonly)
18 19 20 |
# File 'lib/arachni/state/element_filter.rb', line 18 def forms @forms end |
#links ⇒ Support::LookUp::HashSet (readonly)
21 22 23 |
# File 'lib/arachni/state/element_filter.rb', line 21 def links @links end |
Class Method Details
Instance Method Details
#==(other) ⇒ Object
50 51 52 |
# File 'lib/arachni/state/element_filter.rb', line 50 def ==( other ) hash == other.hash end |
#clear ⇒ Object
58 59 60 61 62 |
# File 'lib/arachni/state/element_filter.rb', line 58 def clear forms.clear links.clear .clear end |
#dump(directory) ⇒ Object
40 41 42 43 44 |
# File 'lib/arachni/state/element_filter.rb', line 40 def dump( directory ) FileUtils.mkdir_p( directory ) IO.binwrite( "#{directory}/sets", Marshal.dump( self ) ) end |
#hash ⇒ Object
54 55 56 |
# File 'lib/arachni/state/element_filter.rb', line 54 def hash [@forms.hash, @links.hash, @cookies.hash].hash end |
#statistics ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/arachni/state/element_filter.rb', line 32 def statistics { forms: forms.size, links: links.size, cookies: .size } end |