Class: IPAddr
- Inherits:
-
Object
- Object
- IPAddr
- Defined in:
- lib/clusterfuck/core_ext/ipaddr.rb
Instance Method Summary collapse
Instance Method Details
#addr ⇒ Object
14 15 16 |
# File 'lib/clusterfuck/core_ext/ipaddr.rb', line 14 def addr to_string end |
#cidr ⇒ Object
6 7 8 |
# File 'lib/clusterfuck/core_ext/ipaddr.rb', line 6 def cidr IPAddr.new(netmask).to_i.to_s(2).count("1") end |
#netmask ⇒ Object
2 3 4 |
# File 'lib/clusterfuck/core_ext/ipaddr.rb', line 2 def netmask _to_string(@mask_addr) end |
#to_cidr ⇒ Object
10 11 12 |
# File 'lib/clusterfuck/core_ext/ipaddr.rb', line 10 def to_cidr to_string + "/" + cidr.to_s end |