Class: ActiveStorage::Service::Configurator

Inherits:
Object
  • Object
show all
Defined in:
activestorage/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.


11
12
13
# File 'activestorage/lib/active_storage/service/configurator.rb', line 11

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

Instance Attribute Details

#configurationsObject (readonly)

Returns the value of attribute configurations


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

def configurations
  @configurations
end

Class Method Details

.build(service_name, configurations) ⇒ Object


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

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

Instance Method Details

#build(service_name) ⇒ Object


15
16
17
18
19
20
# File 'activestorage/lib/active_storage/service/configurator.rb', line 15

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