Class: Hosts

Inherits:
Object
  • Object
show all
Defined in:
lib/vmfloaty/hosts.rb

Overview

manage hosts used from vm pooler

Instance Method Summary collapse

Constructor Details

#initializeHosts

Returns a new instance of Hosts.



3
4
5
# File 'lib/vmfloaty/hosts.rb', line 3

def initialize
  @host_list = {}
end

Instance Method Details

#add_host(host_hash) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/vmfloaty/hosts.rb', line 7

def add_host(host_hash)
  host_hash.each do |k,v|
    if @host_list[k]
      @host_list[k].push(v)
    else
      if v.is_a?(Array)
        @host_list[k] = v
      else
        @host_list[k] = [v]
      end
    end
  end

  puts @host_list
end


26
27
28
# File 'lib/vmfloaty/hosts.rb', line 26

def print_host_list
  puts @host_list
end

#remove_host(host_id) ⇒ Object



23
24
# File 'lib/vmfloaty/hosts.rb', line 23

def remove_host(host_id)
end