Module: Pixmatch::Client::List

Included in:
Pixmatch::Client
Defined in:
lib/pixmatch/client/list.rb

Instance Method Summary collapse

Instance Method Details

#list(offset = 0, limit = 0) ⇒ Object

List the contents of the collection.

Parameters:

  • offset (Integer) (defaults to: 0)

    Offset to start at, default is zero.

  • limit (Integer) (defaults to: 0)

    Limit number of results, default is zero (all results).



7
8
9
10
11
12
13
# File 'lib/pixmatch/client/list.rb', line 7

def list(offset = 0, limit = 0) 
  response = request(:get, 'rest', { method: 'list', offset: offset, limit: limit })
  result = response['result']
  raise "Missing result in response." if result.nil?
  raise "Invalid result in response (#{result.class.name})." if ! result.is_a?(Array)
  result
end