Class: MiniSql::Serializer

Inherits:
Array
  • Object
show all
Defined in:
lib/mini_sql/serializer.rb

Constant Summary collapse

MAX_CACHE_SIZE =
500

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ Serializer

Returns a new instance of Serializer.



7
8
9
# File 'lib/mini_sql/serializer.rb', line 7

def initialize(result)
  replace(result)
end

Class Method Details

.marshallable(result) ⇒ Object



11
12
13
# File 'lib/mini_sql/serializer.rb', line 11

def self.marshallable(result)
  new(result)
end

Instance Method Details

#marshal_dumpObject



15
16
17
# File 'lib/mini_sql/serializer.rb', line 15

def marshal_dump
  serialize
end

#marshal_load(wrapper) ⇒ Object



19
20
21
# File 'lib/mini_sql/serializer.rb', line 19

def marshal_load(wrapper)
  replace self.class.materialize(wrapper)
end