toResource method

Resource toResource(
  1. String getId()
)

Converts this to a real Resource object, assigning the id if necessary.

Implementation

Resource toResource(String Function() getId) {
  final resource = Resource(type, id ?? getId());
  resource.attributes.addAll(attributes);
  resource.relationships.addAll(_toRelationships(resource.id));
  resource.meta.addAll(meta);
  return resource;
}