Class: ActiveStorage::Service::Configurator
- Defined in:
- activestorage/lib/active_storage/service/configurator.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#configurations ⇒ Object
readonly
Returns the value of attribute configurations.
Class Method Summary collapse
Instance Method Summary collapse
- #build(service_name) ⇒ Object
-
#initialize(configurations) ⇒ Configurator
constructor
A new instance of Configurator.
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
#configurations ⇒ Object (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 |