Emi Matchu
e52838ba70
Just packing some serialization complexity away into its own thing, so the model code doesn't need to sweat it!
11 lines
No EOL
171 B
Ruby
11 lines
No EOL
171 B
Ruby
module Serializers
|
|
module IntegerSet
|
|
def self.dump(array)
|
|
array.sort.join(",")
|
|
end
|
|
|
|
def self.load(string)
|
|
(string || "").split(",").map(&:to_i)
|
|
end
|
|
end
|
|
end |