Sha256: 801eb1ee60da705db87a990723b7378d4085142b3bb1f898827f90fd83ae60d2

Contents?: true

Size: 355 Bytes

Versions: 24

Compression:

Stored size: 355 Bytes

Contents

module Toy
  module Extensions
    module Array
      def store_default
        []
      end

      def to_store(value, *)
        value = value.respond_to?(:lines) ? value.lines : value
        value.to_a
      end

      def from_store(value, *)
        value || store_default
      end
    end
  end
end

class Array
  extend Toy::Extensions::Array
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
toystore-0.13.2 lib/toy/extensions/array.rb
toystore-0.13.1 lib/toy/extensions/array.rb
toystore-0.13.0 lib/toy/extensions/array.rb
toystore-0.12.0 lib/toy/extensions/array.rb
toystore-0.11.0 lib/toy/extensions/array.rb
toystore-0.10.4 lib/toy/extensions/array.rb
toystore-0.10.3 lib/toy/extensions/array.rb
toystore-0.10.2 lib/toy/extensions/array.rb
toystore-0.10.1 lib/toy/extensions/array.rb
toystore-0.10.0 lib/toy/extensions/array.rb
toystore-0.9.0 lib/toy/extensions/array.rb
toystore-0.8.3 lib/toy/extensions/array.rb
toystore-0.8.2 lib/toy/extensions/array.rb
toystore-0.8.1 lib/toy/extensions/array.rb
toystore-0.8.0 lib/toy/extensions/array.rb
toystore-0.7.0 lib/toy/extensions/array.rb
toystore-0.6.6 lib/toy/extensions/array.rb
toystore-0.6.5 lib/toy/extensions/array.rb
toystore-0.6.4 lib/toy/extensions/array.rb
toystore-0.6.3 lib/toy/extensions/array.rb