impress/lib/serializers/integer_set.rb

11 lines
171 B
Ruby
Raw Normal View History

module Serializers
module IntegerSet
def self.dump(array)
array.sort.join(",")
end
def self.load(string)
(string || "").split(",").map(&:to_i)
end
end
end