Class: Arachni::Data::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/arachni/data/session.rb

Overview

Data for Session.

Author:

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSession

Returns a new instance of Session.



20
21
22
# File 'lib/arachni/data/session.rb', line 20

def initialize
    @configuration = {}
end

Instance Attribute Details

#configurationHash (readonly)

Returns:



18
19
20
# File 'lib/arachni/data/session.rb', line 18

def configuration
  @configuration
end

Class Method Details

.load(directory) ⇒ Object



34
35
36
37
38
# File 'lib/arachni/data/session.rb', line 34

def self.load( directory )
    session = new
    session.configuration.merge! Marshal.load( IO.binread( "#{directory}/configuration" ) )
    session
end

Instance Method Details

#clearObject



40
41
42
# File 'lib/arachni/data/session.rb', line 40

def clear
    @configuration.clear
end

#dump(directory) ⇒ Object



28
29
30
31
32
# File 'lib/arachni/data/session.rb', line 28

def dump( directory )
    FileUtils.mkdir_p( directory )

    IO.binwrite( "#{directory}/configuration", Marshal.dump( @configuration ) )
end

#statisticsObject



24
25
26
# File 'lib/arachni/data/session.rb', line 24

def statistics
    {}
end