Class: TSVAdapter::IntegerArraySerializer
- Inherits:
-
Object
- Object
- TSVAdapter::IntegerArraySerializer
- Defined in:
- lib/scout/persist/tsv/serialize.rb
Constant Summary collapse
- NIL_INT =
-999
Class Method Summary collapse
Class Method Details
.dump(a) ⇒ Object
36 |
# File 'lib/scout/persist/tsv/serialize.rb', line 36 def self.dump(a); a.collect{|v| v || NIL_INT}.pack("l*"); end |
.load(str) ⇒ Object
37 |
# File 'lib/scout/persist/tsv/serialize.rb', line 37 def self.load(str); a = str.unpack("l*"); a.collect{|v| v == NIL_INT ? nil : v}; end |