Skip to content

Commit

Permalink
Get rid of the extra load() calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
H. Wade Minter committed Jan 31, 2013
1 parent ca7d6f6 commit d35e389
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/fog/rackspace/models/dns/zones.rb
Expand Up @@ -8,9 +8,9 @@ class Zones < Fog::Collection

model Fog::DNS::Rackspace::Zone

def all
def all(options={})
clear
data = service.list_domains.body['domains']
data = service.list_domains(options).body['domains']
load(data)
end

Expand All @@ -29,7 +29,7 @@ def each
self
else
body = service.list_domains.body
subset = load(body['domains'])
subset = dup.all

subset.each_zone_this_page {|f| yield f}
while !body['links'].select{|l| l['rel'] == 'next'}.empty?
Expand All @@ -38,7 +38,7 @@ def each
parsed = CGI.parse($1)

body = service.list_domains(:offset => parsed['offset'], :limit => parsed['limit']).body
subset = load(body['domains'])
subset = dup.all(:offset => parsed['offset'], :limit => parsed['limit'])
subset.each_zone_this_page {|f| yield f}
end
self
Expand Down

0 comments on commit d35e389

Please sign in to comment.