Class: Pec::Network::Subnet

Inherits:
Object show all
Extended by:
Query
Defined in:
lib/pec/network/subnet.rb

Class Method Summary collapse

Methods included from Query

fetch, get_ref, list

Class Method Details

.fetch_by_cidr(cidr) ⇒ Object



6
7
8
9
10
# File 'lib/pec/network/subnet.rb', line 6

def fetch_by_cidr(cidr)
  subnet = list.find {|p| p["cidr"] == cidr }
  raise(Pec::Errors::Subnet, "cidr:#{cidr} is not fond!") unless subnet
  subnet
end