Last active
August 29, 2015 14:25
-
-
Save kannan4k/62c0e455f83ba6016eaf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def load_next_batch | |
response = self.bridge.next_batch(self.url, self.name, self.options, self.is_singleton) | |
puts "Self.model" | |
puts self.model | |
batch = response[:items] | |
self.has_more = !self.is_singleton && response[:has_more] | |
if self.is_singleton | |
self.loaded = [ self.model.from_raw(batch, self.cache, response[:supplemental] || {}) ] | |
else | |
self.loaded += batch.map { |o| self.model.from_raw(o, self.cache, response[:supplemental] || {}) } | |
end | |
batch != [] && batch != {} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment