Sha256: e8f6f659b01b7424196a9b31118bd0d4aeeff638538bf164cdbfe40af9826e97

Contents?: true

Size: 338 Bytes

Versions: 12

Compression:

Stored size: 338 Bytes

Contents

module Toy
  module Extensions
    module Array
      def to_store(value, *)
        value = value.respond_to?(:lines) ? value.lines : value
        Marshal.dump(value.to_a)
      end

      def from_store(value, *)
        value.nil? ? store_default : (value.class.is_a?(Array) ? value : Marshal.load(value))
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
toy-dynamo-0.0.12 lib/toy/dynamo/extensions/array.rb
toy-dynamo-0.0.11 lib/toy/dynamo/extensions/array.rb
toy-dynamo-0.0.10 lib/toy/dynamo/extensions/array.rb
toy-dynamo-0.0.9 lib/toy/dynamo/extensions/array.rb
toy-dynamo-0.0.8 lib/toy/dynamo/extensions/array.rb
toy-dynamo-0.0.7 lib/toy/dynamo/extensions/array.rb
toy-dynamo-0.0.6 lib/toy/dynamo/extensions/array.rb
toy-dynamo-0.0.5 lib/toy/dynamo/extensions/array.rb
toy-dynamo-0.0.4 lib/toy/dynamo/extensions/array.rb
toy-dynamo-0.0.3 lib/toy/dynamo/extensions/array.rb
toy-dynamo-0.0.2 lib/toy/dynamo/extensions/array.rb
toy-dynamo-0.0.1 lib/toy/dynamo/extensions/array.rb