Sha256: 750a53ddb7690b5fc25ba690d1c2c97cc6c0fa8c9512440c465692c38bd1229a

Contents?: true

Size: 798 Bytes

Versions: 1

Compression:

Stored size: 798 Bytes

Contents

module Cas
  class RemoteCallbacks
    INITIAL_SETUP ||= {
      # Process images here and return a hash
      #
      #   {
      #     small:  small_image,
      #     medium: medium_image,
      #     big:    big_image
      #   }
      #
      # `original` should not be present after Shrine 3.0. If it is not, we will
      # merge it afterwards automatically.
      uploaded_image_versions: ->(original) {
        {}
      },

      # Class to be called after image was saved.
      after_file_upload: ->(file) { }
    }.freeze

    @@callbacks ||= INITIAL_SETUP

    def self.reset
      @@callbacks ||= INITIAL_SETUP
    end

    def self.callbacks=(callbacks_hash)
      @@callbacks = INITIAL_SETUP.merge(callbacks_hash)
    end

    def self.callbacks
      @@callbacks
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cas-cms-1.0.0.alpha2 lib/cas/remote_callbacks.rb