Class: Pec::Network::Subnet
Class Method Summary
collapse
Methods included from Query
fetch, get_name, 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
|