Method: Joey::RestAPI#extract_fetching_array

Defined in:
lib/joey/rest_api.rb

#extract_fetching_array(hash, klass) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/joey/rest_api.rb', line 52

def extract_fetching_array(hash, klass)
  f = Joey::FetchingArray.new
  f.concat(hash["data"])
  f.client = self
  f.classes = Array(klass)
  if hash["paging"]
    f.next_url = hash["paging"]["next"]
    f.previous_url = hash["paging"]["previous"]
  end
  f
end