Class: Arachni::Support::Database::Base Abstract
- Defined in:
- lib/arachni/support/database/base.rb
Overview
This class is abstract.
Base class for Database data structures
Provides helper methods for data structures to be implemented related to objecting dumping, loading, unique filename generation, etc.
Instance Method Summary collapse
-
#initialize(serializer = Marshal) ⇒ Base
constructor
A new instance of Base.
- #serialize(obj) ⇒ Object
- #unserialize(data) ⇒ Object
Constructor Details
#initialize(serializer = Marshal) ⇒ Base
Returns a new instance of Base.
24 25 26 27 |
# File 'lib/arachni/support/database/base.rb', line 24 def initialize( serializer = Marshal ) @serializer = serializer @filename_counter = 0 end |
Instance Method Details
#serialize(obj) ⇒ Object
29 30 31 |
# File 'lib/arachni/support/database/base.rb', line 29 def serialize( obj ) compress( serializer.dump( obj ) ) end |
#unserialize(data) ⇒ Object
33 34 35 |
# File 'lib/arachni/support/database/base.rb', line 33 def unserialize( data ) serializer.load( decompress( data ) ) end |