Method: Clouder::Entity.all

Defined in:
lib/clouder/entity.rb

.all(options = {}) ⇒ Object

If options is nil, returns an array containing all URIs of existing objects for this class. Sort order is from the most recent to the oldest.

For other results, options can be:

:resolved

If true, returns full objects instead of URIs.

:offset

A positive integer, starting at 0, offsetting the result.

:limit

A positive integer, limiting the results.

All options can be combined.

Note.all 
Note.all(:resolved => true)
Note.all(:offset => 20, :limit => 10)
Note.all(:resolved => true, :limit => 20, :offset => 10)


41
42
43
44
45
# File 'lib/clouder/entity.rb', line 41

def all(options = {})
  uri = options[:resolved] ? File.join(@uri, "_resolved") : @uri
  result = Rest.get(Rest.paramify_url(uri, options))
  options[:resolved] ? result["documents"].map { |d| new(d) } : result["uris"]
end