Class: Joey::FetchingArray
- Inherits:
-
Array
- Object
- Array
- Joey::FetchingArray
- Defined in:
- lib/joey/fetching_array.rb
Instance Attribute Summary collapse
-
#classes ⇒ Object
Returns the value of attribute classes.
-
#client ⇒ Object
Returns the value of attribute client.
-
#count ⇒ Object
Returns the value of attribute count.
-
#next_url ⇒ Object
Returns the value of attribute next_url.
-
#previous_url ⇒ Object
Returns the value of attribute previous_url.
Instance Method Summary collapse
Instance Attribute Details
#classes ⇒ Object
Returns the value of attribute classes.
3 4 5 |
# File 'lib/joey/fetching_array.rb', line 3 def classes @classes end |
#client ⇒ Object
Returns the value of attribute client.
3 4 5 |
# File 'lib/joey/fetching_array.rb', line 3 def client @client end |
#count ⇒ Object
Returns the value of attribute count.
3 4 5 |
# File 'lib/joey/fetching_array.rb', line 3 def count @count end |
#next_url ⇒ Object
Returns the value of attribute next_url.
3 4 5 |
# File 'lib/joey/fetching_array.rb', line 3 def next_url @next_url end |
#previous_url ⇒ Object
Returns the value of attribute previous_url.
3 4 5 |
# File 'lib/joey/fetching_array.rb', line 3 def previous_url @previous_url end |
Instance Method Details
#fetch_next ⇒ Object
5 6 7 8 9 10 11 12 13 |
# 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 ⇒ Object
15 16 17 18 19 20 21 22 23 |
# 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 |