Class: InstanceSelector::Providers::Override

Inherits:
AbstractProvider show all
Defined in:
lib/instance_selector/providers/override.rb

Overview

Uses the HOSTS environment variable instead of a cloud provider

Instance Method Summary collapse

Constructor Details

#initialize(_options = {}) ⇒ Override

Returns a new instance of Override.



5
6
7
# File 'lib/instance_selector/providers/override.rb', line 5

def initialize(_options = {})
  @hosts = ENV['HOSTS']
end

Instance Method Details

#instances(_args = {}) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/instance_selector/providers/override.rb', line 9

def instances(_args = {})
  results = {}
  ENV['HOSTS'].split(',').each do |host|
    results[host] = { name: host, identifier: 'N/A' }
  end

  results
end