Class: Service::DigitalOceanService

Inherits:
S3Service
  • Object
show all
Defined in:
lib/active_storage/service/digital_ocean_service.rb

Overview

Wraps the DigitalOcean Spaces as an Active Storage service. See ActiveStorage::Service for the generic API documentation that applies to all services.

Instance Method Summary collapse

Constructor Details

#initialize(space_name:, upload: {}, **options) ⇒ DigitalOceanService

Returns a new instance of DigitalOceanService.



9
10
11
12
13
14
15
16
# File 'lib/active_storage/service/digital_ocean_service.rb', line 9

def initialize(space_name:, upload: {}, **options)
  options[:access_key_id] = options.delete(:spaces_access_key)
  options[:secret_access_key] = options.delete(:spaces_secret_key)

  raise ActiveStorage::UnavailableConfigurationError if upload[:server_side_encryption]

  super(bucket: space_name, upload: upload, **options)
end