Sha256: 73b2bfad706beca227a9c12bd0c04d37393f65dde0a1115899a4725b380948ac

Contents?: true

Size: 337 Bytes

Versions: 37

Compression:

Stored size: 337 Bytes

Contents

# @private
class IPAddr
  PrivateRanges = [
    IPAddr.new("10.0.0.0/8"),
    IPAddr.new("172.16.0.0/12"),
    IPAddr.new("192.168.0.0/16")
  ]

  def private?
    return false unless self.ipv4?
    PrivateRanges.each do |ipr|
      return true if ipr.include?(self)
    end
    return false
  end

  def public?
    !private?
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
blather-0.8.0 lib/blather/core_ext/ipaddr.rb
blather-0.7.1 lib/blather/core_ext/ipaddr.rb
blather-0.7.0 lib/blather/core_ext/ipaddr.rb
blather-0.6.2 lib/blather/core_ext/ipaddr.rb
blather-0.6.1 lib/blather/core_ext/ipaddr.rb
blather-0.6.0 lib/blather/core_ext/ipaddr.rb
blather-0.5.12 lib/blather/core_ext/ipaddr.rb
blather-0.5.11 lib/blather/core_ext/ipaddr.rb
blather-0.5.10 lib/blather/core_ext/ipaddr.rb
blather-0.5.9 lib/blather/core_ext/ipaddr.rb
blather-0.5.8 lib/blather/core_ext/ipaddr.rb
blather-0.5.7 lib/blather/core_ext/ipaddr.rb
blather-0.5.6 lib/blather/core_ext/ipaddr.rb
blather-0.5.4 lib/blather/core_ext/ipaddr.rb
blather-0.5.3 lib/blather/core_ext/ipaddr.rb
blather-0.5.2 lib/blather/core_ext/ipaddr.rb
blather-0.5.0 lib/blather/core_ext/ipaddr.rb