Class: ActiveStorage::Service::Configurator

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

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configurations) ⇒ Configurator

Returns a new instance of Configurator.



8
9
10
# File 'lib/active_storage/service/configurator.rb', line 8

def initialize(configurations)
  @configurations = configurations.deep_symbolize_keys
end

Instance Attribute Details

#configurationsObject (readonly)

Returns the value of attribute configurations.



2
3
4
# File 'lib/active_storage/service/configurator.rb', line 2

def configurations
  @configurations
end

Class Method Details

.build(service_name, configurations) ⇒ Object



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

def self.build(service_name, configurations)
  new(configurations).build(service_name)
end

Instance Method Details

#build(service_name) ⇒ Object



12
13
14
15
# File 'lib/active_storage/service/configurator.rb', line 12

def build(service_name)
  config = config_for(service_name.to_sym)
  resolve(config.fetch(:service)).build(**config, configurator: self)
end