Sha256: e5b571d434438479f9f6e70c7c6919d9e2f1c10ade790b362d415ad7a8134eb7

Contents?: true

Size: 711 Bytes

Versions: 8

Compression:

Stored size: 711 Bytes

Contents

# frozen_string_literal: true

module Ckeditor
  module Backend
    module Paperclip
      def self.included(base)
        base.send(:include, InstanceMethods)
        base.send(:extend, ClassMethods)
      end

      module ClassMethods
        def self.extended(base)
          base.class_eval do
            delegate :url, :path, :styles, :content_type, to: :data
          end
        end
      end

      module InstanceMethods
        def geometry
          @geometry ||= ::Paperclip::Geometry.from_file(file)
        end

        protected

        def file
          @file ||= data.respond_to?(:queued_for_write) ? data.queued_for_write[:original] : data.to_file
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
ckeditor-5.1.3 lib/ckeditor/backend/paperclip.rb
ckeditor-5.1.2 lib/ckeditor/backend/paperclip.rb
ckeditor-5.1.1 lib/ckeditor/backend/paperclip.rb
glebtv-ckeditor-4.14.1 lib/ckeditor/backend/paperclip.rb
ckeditor-5.1.0 lib/ckeditor/backend/paperclip.rb
glebtv-ckeditor-4.13.1 lib/ckeditor/backend/paperclip.rb
glebtv-ckeditor-4.13.0 lib/ckeditor/backend/paperclip.rb
ckeditor-5.0.0 lib/ckeditor/backend/paperclip.rb