View Source ROR.Results (ROR v0.1.0)

A structure and tools for search and list results

This struct supports the Enum protocol, so you can directly iterate the Organizations within.

Summary

Functions

Extract a Results struct, containing Organizations, from the JSON returned by the ROR query and list API.

Returns total number of results (not just the set of up to 20 returned in the current page)

Returns a list of all Organizations in the Results

Returns a list of all Organizations in the Results but you're less likely to use an 's' by mistake

Returns time taken by query on the API service (ms)

Types

t()

@type t() :: %ROR.Results{
  items: [ROR.Organization.t()],
  results: integer(),
  time: integer()
}

Functions

extract(data)

@spec extract(data :: map()) :: t()

Extract a Results struct, containing Organizations, from the JSON returned by the ROR query and list API.

If you are retrieving records via the ROR module and the REST API you will not need to use this function yourself.

number_of_results(results)

@spec number_of_results(results :: t()) :: integer()

Returns total number of results (not just the set of up to 20 returned in the current page)

organizations(results)

@spec organizations(results :: t()) :: [ROR.Organization.t()]

Returns a list of all Organizations in the Results

orgs(results)

@spec orgs(results :: t()) :: [ROR.Organization.t()]

Returns a list of all Organizations in the Results but you're less likely to use an 's' by mistake

time_taken(results)

@spec time_taken(results :: t()) :: integer()

Returns time taken by query on the API service (ms)