mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Change method from dig to deep fetch
This commit is contained in:
parent
71c8eb38bf
commit
f4064167bb
1 changed files with 3 additions and 3 deletions
|
@ -17,7 +17,7 @@ module Fog
|
|||
end
|
||||
|
||||
private
|
||||
def dig(hash, *path)
|
||||
def deep_fetch(hash, *path)
|
||||
path.inject(hash) do |acc, key|
|
||||
acc.respond_to?(:keys) ? acc[key] : nil
|
||||
end
|
||||
|
@ -30,8 +30,8 @@ module Fog
|
|||
end
|
||||
|
||||
def get_paged_links(links)
|
||||
next_link = dig(links, "pages", "next").to_s
|
||||
last_link = dig(links, "pages", "last").to_s
|
||||
next_link = deep_fetch(links, "pages", "next").to_s
|
||||
last_link = deep_fetch(links, "pages", "last").to_s
|
||||
@next = get_page(next_link) || @next
|
||||
@last = get_page(last_link) || @last
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue