Class: Tupelo::Archiver::PersistentTuplespace::Rec

Inherits:
Object
  • Object
show all
Defined in:
lib/tupelo/archiver/persistent-tuplespace.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ts, obj) ⇒ Rec

Returns a new instance of Rec.



15
16
17
18
19
20
# File 'lib/tupelo/archiver/persistent-tuplespace.rb', line 15

def initialize ts, obj
  @id = ts.next_id
  @count = 0
  @packed = MessagePack.pack(obj)
  @next_rec_to_save = nil
end

Instance Attribute Details

#countObject

Returns the value of attribute count.



9
10
11
# File 'lib/tupelo/archiver/persistent-tuplespace.rb', line 9

def count
  @count
end

#idObject

Returns the value of attribute id.



8
9
10
# File 'lib/tupelo/archiver/persistent-tuplespace.rb', line 8

def id
  @id
end

#next_rec_to_saveObject

linked list of recs to update to db



13
14
15
# File 'lib/tupelo/archiver/persistent-tuplespace.rb', line 13

def next_rec_to_save
  @next_rec_to_save
end

#packedObject

Returns the value of attribute packed.



10
11
12
# File 'lib/tupelo/archiver/persistent-tuplespace.rb', line 10

def packed
  @packed
end

Instance Method Details

#unmark_to_saveObject



22
23
24
# File 'lib/tupelo/archiver/persistent-tuplespace.rb', line 22

def unmark_to_save
  @next_rec_to_save = nil
end