Sha256: 7fd4a39efafe86f4afe0abb557fdfb3f137d4b4cad7259b8d9fbf3af74656114

Contents?: true

Size: 397 Bytes

Versions: 8

Compression:

Stored size: 397 Bytes

Contents

require 'yaml'

module ActiveRecord
  module Wrappings #:nodoc:
    class YamlWrapper < AbstractWrapper #:nodoc:
      def wrap(attribute)   attribute.to_yaml end
      def unwrap(attribute) YAML::load(attribute) end
    end

    module ClassMethods #:nodoc:
      # Wraps the attribute in Yaml encoding
      def wrap_in_yaml(*attributes) wrap_with(YamlWrapper, attributes) end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/rails/activerecord/lib/active_record/wrappers/yaml_wrapper.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/rails/activerecord/lib/active_record/wrappers/yaml_wrapper.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/rails/activerecord/lib/active_record/wrappers/yaml_wrapper.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/rails/activerecord/lib/active_record/wrappers/yaml_wrapper.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/rails/activerecord/lib/active_record/wrappers/yaml_wrapper.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/rails/activerecord/lib/active_record/wrappers/yaml_wrapper.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/rails/activerecord/lib/active_record/wrappers/yaml_wrapper.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/rails/activerecord/lib/active_record/wrappers/yaml_wrapper.rb