class DMAO::API::Funder

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/funder.rb, line 32
def self.instance_from_api_data data

  attributes = {
      id: data["id"],
      institution_id: data["relationships"]["institution"]["data"]["id"],
      name: data["attributes"]["name"],
      parent_group: data["attributes"]["parent-group"],
      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/funder.rb, line 21
def initialize(attributes)

  @id = attributes[:id]
  @institution_id = attributes[:institution_id]
  @name = attributes[:name]
  @parent_group = attributes[:parent_group]
  @system_uuid = attributes[:system_uuid]
  @system_modified_at = attributes[:system_modified_at]

end