Module: OnlyofficeDigitaloceanWrapper::IpGetters
- Included in:
- DigitalOceanWrapper
- Defined in:
- lib/onlyoffice_digitalocean_wrapper/digitalocean_wrapper/ip_getters.rb
Overview
Get methods for IP
Instance Method Summary collapse
-
#droplet_ip(droplet, network_type = 'public') ⇒ String?
Get ip of droplet.
-
#public_ip(droplet) ⇒ String?
Get public ip of droplet.
Instance Method Details
#droplet_ip(droplet, network_type = 'public') ⇒ String?
Get ip of droplet
10 11 12 13 14 15 16 |
# File 'lib/onlyoffice_digitalocean_wrapper/digitalocean_wrapper/ip_getters.rb', line 10 def droplet_ip(droplet, network_type = 'public') networks = droplet.networks.to_a.first specific_network = networks.find { |net| net.type == network_type } return nil unless specific_network specific_network.ip_address end |
#public_ip(droplet) ⇒ String?
Get public ip of droplet
21 22 23 |
# File 'lib/onlyoffice_digitalocean_wrapper/digitalocean_wrapper/ip_getters.rb', line 21 def public_ip(droplet) droplet_ip(droplet, 'public') end |