class DMAO::API::Person
Constants
- ENDPOINT
- INVALID_ENTITY_CLASS
- INVALID_ENTITY_ERROR_MESSAGE
- INVALID_ID_ERROR
- NOT_FOUND_ERROR
- VALID_ATTRIBUTES
Public Class Methods
instance_from_api_data(data)
click to toggle source
# File lib/dmao/api/person.rb, line 35 def self.instance_from_api_data data attributes = { id: data["id"], institution_id: data["relationships"]["institution"]["data"]["id"], first_name: data["attributes"]["first-name"], last_name: data["attributes"]["last-name"], email: data["attributes"]["email"], image_link: data["attributes"]["image-link"], orcid: data["attributes"]["orcid"], system_uuid: data["attributes"]["system-uuid"], system_modified_at: data["attributes"]["system-modified-at"] } new(attributes) end
new(attributes)
click to toggle source
# File lib/dmao/api/person.rb, line 21 def initialize(attributes) @id = attributes[:id] @institution_id = attributes[:institution_id] @first_name = attributes[:first_name] @last_name = attributes[:last_name] @email = attributes[:email] @image_link = attributes[:image_link] @orcid = attributes[:orcid] @system_uuid = attributes[:system_uuid] @system_modified_at = attributes[:system_modified_at] end