Class: ZerigoDNS::Zone
- Defined in:
- lib/zerigodns/zone.rb
Class Method Summary collapse
-
.count ⇒ Fixnum
Get count of all zones.
-
.find_by_domain(domain) ⇒ Zone
Find zone by domain name.
-
.find_or_create(domain) ⇒ Zone
Find or Create Zone.
Instance Method Summary collapse
-
#count_hosts ⇒ Fixnum
Get count of all hosts belonging to this zone.
Methods inherited from Base
Class Method Details
.count ⇒ Fixnum
Get count of all zones
5 6 7 |
# File 'lib/zerigodns/zone.rb', line 5 def count get(:count).to_i end |
.find_by_domain(domain) ⇒ Zone
Find zone by domain name
13 14 15 |
# File 'lib/zerigodns/zone.rb', line 13 def find_by_domain(domain) find(domain) end |
.find_or_create(domain) ⇒ Zone
Find or Create Zone
20 21 22 23 24 |
# File 'lib/zerigodns/zone.rb', line 20 def find_or_create(domain) find_by_domain(domain) rescue ActiveResource::ResourceNotFound create(:domain=> domain, :ns_type=>'pri_sec') end |
Instance Method Details
#count_hosts ⇒ Fixnum
Get count of all hosts belonging to this zone
29 30 31 |
# File 'lib/zerigodns/zone.rb', line 29 def count_hosts get('hosts/count').to_i end |