Class: Pec::Network::Subnet

Inherits:
Object
  • Object
show all
Includes:
Query
Defined in:
lib/pec/network/subnet.rb

Instance Method Summary collapse

Methods included from Query

#get_adapter, #get_ref, #list

Instance Method Details

#fetch(cidr) ⇒ Object



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

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