module Shrine::Plugins::DirectUpload::ClassMethods

  1. lib/shrine/plugins/direct_upload.rb

Methods

Public Instance

  1. assign_upload_endpoint
  2. inherited

Public Instance methods

assign_upload_endpoint (klass)

Assigns the subclassed endpoint as the UploadEndpoint constant.

[show source]
# File lib/shrine/plugins/direct_upload.rb, line 185
def assign_upload_endpoint(klass)
  endpoint_class = Class.new(klass)
  endpoint_class.opts[:shrine_class] = self
  const_set(:UploadEndpoint, endpoint_class)
end
inherited (subclass)

Assigns the subclass a copy of the upload endpoint class.

[show source]
# File lib/shrine/plugins/direct_upload.rb, line 179
def inherited(subclass)
  super
  subclass.assign_upload_endpoint(self::UploadEndpoint)
end