Class: Bosh::Director::DeploymentPlan::IpProviderFactory
- Defined in:
- lib/bosh/director/deployment_plan/ip_provider/ip_provider_factory.rb
Instance Method Summary collapse
-
#initialize(using_global_networking, logger) ⇒ IpProviderFactory
constructor
A new instance of IpProviderFactory.
- #new_ip_provider(networks) ⇒ Object
Constructor Details
#initialize(using_global_networking, logger) ⇒ IpProviderFactory
Returns a new instance of IpProviderFactory.
4 5 6 7 |
# File 'lib/bosh/director/deployment_plan/ip_provider/ip_provider_factory.rb', line 4 def initialize(using_global_networking, logger) @using_global_networking = using_global_networking @logger = logger end |
Instance Method Details
#new_ip_provider(networks) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bosh/director/deployment_plan/ip_provider/ip_provider_factory.rb', line 9 def new_ip_provider(networks) if @using_global_networking @logger.debug('Using database ip repo') ip_repo = DatabaseIpRepo.new(@logger) else @logger.debug('Using in-memory ip repo') ip_repo = InMemoryIpRepo.new(@logger) end IpProvider.new(ip_repo, networks, @logger) end |