support/ruby/collins-client/lib/collins/asset.rb
def gateway_address pool = "default"
      address = addresses.select{|a| a.pool == pool}.map{|a| a.gateway}.first
      return address if address
      if addresses.length > 0 then
        addresses.first.gateway
      else
        nil
      end
    end
# Return the gateway address for the specified pool, or the first gateway
# @note If there is no address in the specified pool, the gateway of the first usable address is
# used, which may not be desired.
# @param [String] pool The address pool to find a gateway on
# @return [String] Gateway address, or nil
Return the gateway address for the specified pool, or the first gateway
Return the gateway address for the specified pool or the first gateway
def gateway_address pool = "default"
      address = addresses.select{|a| a.pool == pool}.map{|a| a.gateway}.first
      return address if address
      if addresses.length > 0 then
        addresses.first.gateway
      else
        nil
      end
    end
def gateway_address pool = "default" address = addresses . select { | a | a . pool == pool } . map { | a | a . gateway } . first return address if address if addresses . length > 0 then addresses . first . gateway else nil end end
Return the gateway address for the specified pool, or the first gateway
Return the gateway address for the specified pool or the first gateway
Gateway address, or nil
Gateway address or nil
String
pool
pool The address pool to find a gateway on
pool The address pool to find a gateway on
note
If there is no address in the specified pool, the gateway of the first usable address is used, which may not be desired.
If there is no address in the specified pool the gateway of the first usable address is used which may not be desired .