Class: ActiveZone::Provider::Configurator

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



34
35
36
# File 'lib/active_zone/provider/configurator.rb', line 34

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

Instance Attribute Details

#configurationsObject (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