Method: Hackeroo::Cursor#all

Defined in:
lib/hackeroo/cursor.rb

#all(collection = collection, cursor = next_cursor) ⇒ Array

Parameters:

  • collection (Array) (defaults to: collection)
  • cursor (Integer) (defaults to: next_cursor)

Returns:

  • (Array)


51
52
53
54
55
# File 'lib/hackeroo/cursor.rb', line 51

def all(collection=collection, cursor=next_cursor)
  cursor = @client.send(@method_name.to_sym, @method_options.merge(:cursor => cursor))
  collection += cursor.collection
  cursor.last? ? collection.flatten : all(collection, cursor.next_cursor)
end