Class: IpMapping

Inherits:
Object
  • Object
show all
Defined in:
lib/secured_cloud_api_client/ip_mapping.rb

Overview

A mapping between a set of public IPs and a private IP.

@author

Alan Vella

Instance Method Summary collapse

Constructor Details

#initialize(privateIp, publicIps) ⇒ IpMapping

Returns a new instance of IpMapping.



11
12
13
14
# File 'lib/secured_cloud_api_client/ip_mapping.rb', line 11

def initialize(privateIp, publicIps)
  @privateIp = privateIp
  @publicIps = publicIps
end

Instance Method Details

#get_detailsObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/secured_cloud_api_client/ip_mapping.rb', line 17

def get_details()
  s = ""    
  if (@publicIps == nil) then
    s = "  Public IPs [ - ] => "
  else
    s = "  Public IPs [" + @publicIps.join(", ") + "] => "
  end    
  s += "  Private IP [" + @privateIp + "]"
  return s
end

#get_public_ipsObject



29
30
31
# File 'lib/secured_cloud_api_client/ip_mapping.rb', line 29

def get_public_ips()
  return @publicIps
end