Class: Service::DummyService

Inherits:
Service
  • Object
show all
Defined in:
lib/active_storage/service/dummy_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(**config) ⇒ DummyService

Returns a new instance of DummyService.



4
5
6
# File 'lib/active_storage/service/dummy_service.rb', line 4

def initialize(**config)
  @config = config
end

Instance Method Details

#exist?(key) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
# File 'lib/active_storage/service/dummy_service.rb', line 8

def exist?(key)
  instrument :exist, key: key do |payload|
    true
  end
end

#url(key, expires_in:, filename: nil, content_type:, disposition:, params: {}) ⇒ Object



14
15
16
17
18
# File 'lib/active_storage/service/dummy_service.rb', line 14

def url(key, expires_in:, filename: nil, content_type:, disposition:, params: {})
  instrument :url, key: key do |payload|
    urls.sample
  end
end