Class: ActiveZone::Provider::Configurator
- Inherits:
-
Object
- Object
- ActiveZone::Provider::Configurator
- Defined in:
- lib/active_zone/provider/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(provider_name) ⇒ Object
-
#initialize(configurations) ⇒ Configurator
constructor
A new instance of Configurator.
Constructor Details
#initialize(configurations) ⇒ Configurator
Returns a new instance of Configurator.
34 35 36 |
# File 'lib/active_zone/provider/configurator.rb', line 34 def initialize(configurations) @configurations = configurations.deep_symbolize_keys end |
Instance Attribute Details
#configurations ⇒ Object (readonly)
Returns the value of attribute configurations.
28 29 30 |
# File 'lib/active_zone/provider/configurator.rb', line 28 def configurations @configurations end |
Class Method Details
.build(provider_name, configurations) ⇒ Object
30 31 32 |
# File 'lib/active_zone/provider/configurator.rb', line 30 def self.build(provider_name, configurations) new(configurations).build(provider_name) end |
Instance Method Details
#build(provider_name) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/active_zone/provider/configurator.rb', line 38 def build(provider_name) config = config_for(provider_name.to_sym) resolve(config.fetch(:provider)).build( **config, configurator: self, name: provider_name ) end |