Module: Kamal::Providers
- Defined in:
- lib/kamal/providers/base.rb,
lib/kamal/providers/upcloud.rb
Defined Under Namespace
Classes: AuthenticationError, Base, ProvisioningError, QuotaExceededError, RateLimitError, TimeoutError, Upcloud
Class Method Summary collapse
-
.for(config) ⇒ Kamal::Providers::Base
Factory method to instantiate the appropriate provider.
Class Method Details
.for(config) ⇒ Kamal::Providers::Base
Factory method to instantiate the appropriate provider
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/kamal/providers/base.rb', line 29 def self.for(config) type = config["type"] || config[:type] case type&.to_s&.downcase when "upcloud" require_relative "upcloud" unless defined?(Upcloud) Upcloud.new( username: config["username"] || config[:username], password: config["password"] || config[:password] ) else raise Kamal::Dev::ConfigurationError, "Unknown provider type: #{type.inspect}" end end |