addresses = []
interfaces(options).each do |interface|
+ address = interface[:public_address] || interface[:address]
+
+ next if address.nil?
+
if block.nil?
- addresses << interface[:address]
+ addresses << address
else
- block.call(interface[:address])
+ yield address
end
end
addresses
end
- def internal_ipaddress
- ipaddresses(:role => :internal).first
+ def internal_ipaddress(options = {})
+ ipaddresses(options.merge(:role => :internal)).first
end
- def external_ipaddress
- ipaddresses(:role => :external).first
+ def external_ipaddress(options = {})
+ ipaddresses(options.merge(:role => :external)).first
end
end
end