Sha256: 20054401a50771dbfecdee458c0c70168dd17fb1bb09f705f78214a3b6fff533

Contents?: true

Size: 508 Bytes

Versions: 29

Compression:

Stored size: 508 Bytes

Contents

# Allow Blob attributes to be passed down to the service
# attributes includes
# - key - the string the BlobKey represents
# - content_type
# - filename
module ActiveStorage
  class BlobKey < String
    attr_reader :attributes
    def initialize(attributes)
      if attributes.is_a? Hash
        attributes.symbolize_keys!
        super(attributes[:key])
        @attributes = attributes
      else
        super(attributes)
        @attributes = {key: attributes} if attributes
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
cloudinary-1.17.0 lib/active_storage/blob_key.rb
cloudinary-1.16.1 lib/active_storage/blob_key.rb
cloudinary-1.16.0 lib/active_storage/blob_key.rb
cloudinary-1.15.0 lib/active_storage/blob_key.rb
cloudinary-1.14.0 lib/active_storage/blob_key.rb
cloudinary-1.13.2 lib/active_storage/blob_key.rb
cloudinary-1.13.1 lib/active_storage/blob_key.rb
cloudinary-1.13.0 lib/active_storage/blob_key.rb
cloudinary-1.12.0 lib/active_storage/blob_key.rb