O.ref()
Constructs a object implementing the Ref
interface.
There are two options for calling it:
function O.ref(string)
Decode the presentation string representation of a object reference.
Returns null
if the string does not match the format of a valid object reference.
Note that the returned reference may not refer to an object which actually exists, or the current user may not necessarily have permission to read it, so calling load()
on this Ref
is not guaranteed to be able to return an Object
.
function O.ref(objId)
Create a reference object using object ID.
This isn’t likely to be terribly useful, as most Ref objects are constructed for you by the API.
Other argument types
If a Ref
object is passed as the first argument, that object will be returned from the function.
If undefined
or null
is passed as the first argument, null
will be returned from the function.
An exception will be thrown if any other type of object passed to O.ref()
.