Sha256: 45082e200c0da22a8ea858387e58ba2ee8a1deba5eb14632a7252cbec555ebd8
Contents?: true
Size: 510 Bytes
Versions: 25
Compression:
Stored size: 510 Bytes
Contents
require 'socket' module Killbill::PaypalExpress class Utils def self.ip first_public_ipv4 ? first_public_ipv4.ip_address : first_private_ipv4.ip_address end def self.first_private_ipv4 @@first_private_ipv4 ||= Socket.ip_address_list.detect{ |intf| intf.ipv4_private? } end def self.first_public_ipv4 @@first_public_ipv4 ||= Socket.ip_address_list.detect{ |intf| intf.ipv4? and !intf.ipv4_loopback? and !intf.ipv4_multicast? and !intf.ipv4_private? } end end end
Version data entries
25 entries across 25 versions & 1 rubygems