Sha256: e4c5c01b3d63f267b5650ef7d8290f90e63b1f9782951f546ea5688d12c1aaf2

Contents?: true

Size: 610 Bytes

Versions: 71

Compression:

Stored size: 610 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
        when ActionText::RichText
          content.body.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

71 entries across 66 versions & 6 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/actiontext-7.1.3.4/lib/action_text/serialization.rb
actiontext-7.1.5.1 lib/action_text/serialization.rb
actiontext-7.0.8.7 lib/action_text/serialization.rb
actiontext-7.1.5 lib/action_text/serialization.rb
actiontext-7.1.4.2 lib/action_text/serialization.rb
actiontext-7.0.8.6 lib/action_text/serialization.rb
actiontext-6.1.7.10 lib/action_text/serialization.rb
actiontext-6.1.7.9 lib/action_text/serialization.rb
actiontext-7.1.4.1 lib/action_text/serialization.rb
actiontext-7.0.8.5 lib/action_text/serialization.rb
actiontext-7.1.4 lib/action_text/serialization.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actiontext-7.1.3.4/lib/action_text/serialization.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actiontext-7.0.8.4/lib/action_text/serialization.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/actiontext-7.0.5.1/lib/action_text/serialization.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/actiontext-7.0.5.1/lib/action_text/serialization.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/actiontext-7.0.5.1/lib/action_text/serialization.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/actiontext-7.1.3.4/lib/action_text/serialization.rb
actiontext-7.1.3.4 lib/action_text/serialization.rb
actiontext-7.0.8.4 lib/action_text/serialization.rb
actiontext-6.1.7.8 lib/action_text/serialization.rb