class Joey::FetchingArray

Attributes

classes[RW]
client[RW]
count[RW]
next_url[RW]
previous_url[RW]

Public Instance Methods

fetch_next() click to toggle source
# File lib/joey/fetching_array.rb, line 5
def fetch_next
  return [] if next_url.blank?
  # FIXME: following only returns a hash like {"id"=>"http://graph.facebook.com/100000637452380/feed"}
  # try to write a method in koala which can request absolute urls
  additions = client.get_and_map_url(next_url, classes)
  self.next_url = additions.next_url
  self.concat(additions)
  additions
end
fetch_previous() click to toggle source
# File lib/joey/fetching_array.rb, line 15
def fetch_previous
  return [] if previous_url.blank?
  # FIXME: following only returns a hash like {"id"=>"http://graph.facebook.com/100000637452380/feed"}
  # try to write a method in koala which can request absolute urls
  additions = client.get_and_map_url(previous_url, classes)
  self.previous_url = additions.previous_url
  self.unshift(*additions)
  additions
end