Class: ActiveStorage::Service::Configurator
- Inherits:
-
Object
- Object
- ActiveStorage::Service::Configurator
- Defined in:
- 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.
8 9 10 |
# File 'lib/active_storage/service/configurator.rb', line 8 def initialize(configurations) @configurations = configurations.deep_symbolize_keys end |
Instance Attribute Details
#configurations ⇒ Object (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 |