View Source ROR.Link (ROR v0.1.0)

Functions for extracting and using Link data from a ROR Organization record

Summary

Functions

Extracts a list of Link structs from the decoded JSON of a ROR Organization record

Lists the allowed terms or types for this data structure, as atoms.

Types

t()

@type t() :: %ROR.Link{type: atom(), value: binary()}

Functions

extract(data)

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

Extracts a list of Link structs from the decoded JSON of a ROR Organization record

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

Example

iex> record = File.read!("test/support/static/example_org.json") |> Jason.decode!()
...> ROR.Link.extract(record)
[
  %ROR.Link{type: :website, value: "http://www.universityofcalifornia.edu/"},
  %ROR.Link{
    type: :wikipedia,
    value: "http://en.wikipedia.org/wiki/University_of_California"
  }
]

vocab()

@spec vocab() :: [atom()]

Lists the allowed terms or types for this data structure, as atoms.