Sha256: 20331f3a1db1672fe9abbdc196a9d318267755f0e78b372a1b7e0d953f738fb5

Contents?: true

Size: 545 Bytes

Versions: 62

Compression:

Stored size: 545 Bytes

Contents

# frozen_string_literal: true

module ActionText
  module Serialization
    extend ActiveSupport::Concern

    class_methods do
      def load(content)
        new(content) if content
      end

      def dump(content)
        case content
        when nil
          nil
        when self
          content.to_html
        else
          new(content).to_html
        end
      end
    end

    # Marshal compatibility

    class_methods do
      alias_method :_load, :load
    end

    def _dump(*)
      self.class.dump(self)
    end
  end
end

Version data entries

62 entries across 62 versions & 7 rubygems

Version Path
actiontext-6.0.6.1 lib/action_text/serialization.rb
actiontext-6.0.6 lib/action_text/serialization.rb
actiontext-6.0.5.1 lib/action_text/serialization.rb
actiontext5-5.2.0 lib/action_text/serialization.rb
actiontext-6.0.5 lib/action_text/serialization.rb
actiontext-6.0.4.8 lib/action_text/serialization.rb
actiontext-6.1.4.7 lib/action_text/serialization.rb
actiontext-6.0.4.7 lib/action_text/serialization.rb
actiontext-6.1.4.6 lib/action_text/serialization.rb
actiontext-6.0.4.6 lib/action_text/serialization.rb
actiontext-6.0.4.5 lib/action_text/serialization.rb
actiontext-6.1.4.5 lib/action_text/serialization.rb
actiontext-6.1.4.4 lib/action_text/serialization.rb
actiontext-6.0.4.4 lib/action_text/serialization.rb
actiontext-6.1.4.3 lib/action_text/serialization.rb
actiontext-6.0.4.3 lib/action_text/serialization.rb
actiontext-6.0.4.2 lib/action_text/serialization.rb
actiontext-6.1.4.2 lib/action_text/serialization.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/actiontext-6.1.4.1/lib/action_text/serialization.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/actiontext-6.1.4.1/lib/action_text/serialization.rb