Sha256: 412c1b8692299bfa8121ae508865e56db806affd19021703687449a149dbd64c

Contents?: true

Size: 506 Bytes

Versions: 10

Compression:

Stored size: 506 Bytes

Contents

require 'valise/strategies/set'

module Valise
  module Strategies
    class Serialization < Set
      register :raw
      default

      def initialize(options)
      end

      def dump(item)
        item.load_contents
      end

      def load(item)
        item.raw_contents
      end

      class YAML < Serialization
        register :yaml

        def dump(item)
          ::YAML::dump(super)
        end

        def load(item)
          ::YAML::load(super)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
valise-1.2.1 lib/valise/strategies/serialization.rb
valise-1.2.0 lib/valise/strategies/serialization.rb
valise-1.1.4 lib/valise/strategies/serialization.rb
valise-1.1.3 lib/valise/strategies/serialization.rb
valise-1.1.2 lib/valise/strategies/serialization.rb
valise-1.1.1 lib/valise/strategies/serialization.rb
valise-1.1.0 lib/valise/strategies/serialization.rb
valise-1.0.0 lib/valise/strategies/serialization.rb
valise-0.9.1 lib/valise/strategies/serialization.rb
valise-0.9.0 lib/valise/strategies/serialization.rb