Class: V1::SampleResource

Inherits:
JSONAPI::Resource
  • Object
show all
Defined in:
app/resources/v1/sample_resource.rb

Overview

Note:

Access this resource cannot be accessed via the /v1/samples endpoint.

It allows API clients to query, filter, and retrieve sample-related information.

It is only accessible via the nested route under other resources using includes.

Direct Known Subclasses

Pacbio::SampleResource

Instance Attribute Summary collapse

Instance Attribute Details

#accession_numberString

Returns the accession number.

Returns:

  • (String)

    the accession number



37
38
39
# File 'app/resources/v1/sample_resource.rb', line 37

attributes :name, :external_id, :species, :created_at, :deactivated_at,
:sanger_sample_id, :supplier_name, :taxon_id, :donor_id, :country_of_origin,
:accession_number, :date_of_sample_collection, :number_of_donors

#country_of_originString

Returns the country of origin.

Returns:

  • (String)

    the country of origin



37
38
39
# File 'app/resources/v1/sample_resource.rb', line 37

attributes :name, :external_id, :species, :created_at, :deactivated_at,
:sanger_sample_id, :supplier_name, :taxon_id, :donor_id, :country_of_origin,
:accession_number, :date_of_sample_collection, :number_of_donors

#created_atString

Returns the creation date of the sample in US format.

Returns:

  • (String)

    the creation date of the sample in US format



37
38
39
# File 'app/resources/v1/sample_resource.rb', line 37

attributes :name, :external_id, :species, :created_at, :deactivated_at,
:sanger_sample_id, :supplier_name, :taxon_id, :donor_id, :country_of_origin,
:accession_number, :date_of_sample_collection, :number_of_donors

#date_of_sample_collectionString

Returns the date of sample collection.

Returns:

  • (String)

    the date of sample collection



37
38
39
# File 'app/resources/v1/sample_resource.rb', line 37

attributes :name, :external_id, :species, :created_at, :deactivated_at,
:sanger_sample_id, :supplier_name, :taxon_id, :donor_id, :country_of_origin,
:accession_number, :date_of_sample_collection, :number_of_donors

#deactivated_atString?

Returns the deactivation date of the sample in US format; nil if not deactivated.

Returns:

  • (String, nil)

    the deactivation date of the sample in US format; nil if not deactivated



37
38
39
# File 'app/resources/v1/sample_resource.rb', line 37

attributes :name, :external_id, :species, :created_at, :deactivated_at,
:sanger_sample_id, :supplier_name, :taxon_id, :donor_id, :country_of_origin,
:accession_number, :date_of_sample_collection, :number_of_donors

#donor_idString

Returns the donor ID.

Returns:

  • (String)

    the donor ID



37
38
39
# File 'app/resources/v1/sample_resource.rb', line 37

attributes :name, :external_id, :species, :created_at, :deactivated_at,
:sanger_sample_id, :supplier_name, :taxon_id, :donor_id, :country_of_origin,
:accession_number, :date_of_sample_collection, :number_of_donors

#external_idString

Returns the external ID of the sample.

Returns:

  • (String)

    the external ID of the sample



37
38
39
# File 'app/resources/v1/sample_resource.rb', line 37

attributes :name, :external_id, :species, :created_at, :deactivated_at,
:sanger_sample_id, :supplier_name, :taxon_id, :donor_id, :country_of_origin,
:accession_number, :date_of_sample_collection, :number_of_donors

#nameString

Returns the name of the sample.

Returns:

  • (String)

    the name of the sample



37
38
39
# File 'app/resources/v1/sample_resource.rb', line 37

attributes :name, :external_id, :species, :created_at, :deactivated_at,
:sanger_sample_id, :supplier_name, :taxon_id, :donor_id, :country_of_origin,
:accession_number, :date_of_sample_collection, :number_of_donors

#number_of_donorsInteger

Returns the number of donors associated with the sample.

Returns:

  • (Integer)

    the number of donors associated with the sample



37
38
39
# File 'app/resources/v1/sample_resource.rb', line 37

attributes :name, :external_id, :species, :created_at, :deactivated_at,
:sanger_sample_id, :supplier_name, :taxon_id, :donor_id, :country_of_origin,
:accession_number, :date_of_sample_collection, :number_of_donors

#sanger_sample_idString

Returns the Sanger sample ID.

Returns:

  • (String)

    the Sanger sample ID



37
38
39
# File 'app/resources/v1/sample_resource.rb', line 37

attributes :name, :external_id, :species, :created_at, :deactivated_at,
:sanger_sample_id, :supplier_name, :taxon_id, :donor_id, :country_of_origin,
:accession_number, :date_of_sample_collection, :number_of_donors

#speciesString

Returns the species of the sample.

Returns:

  • (String)

    the species of the sample



37
38
39
# File 'app/resources/v1/sample_resource.rb', line 37

attributes :name, :external_id, :species, :created_at, :deactivated_at,
:sanger_sample_id, :supplier_name, :taxon_id, :donor_id, :country_of_origin,
:accession_number, :date_of_sample_collection, :number_of_donors

#supplier_nameString

Returns the name of the supplier.

Returns:

  • (String)

    the name of the supplier



37
38
39
# File 'app/resources/v1/sample_resource.rb', line 37

attributes :name, :external_id, :species, :created_at, :deactivated_at,
:sanger_sample_id, :supplier_name, :taxon_id, :donor_id, :country_of_origin,
:accession_number, :date_of_sample_collection, :number_of_donors

#taxon_idString

Returns the taxon ID.

Returns:

  • (String)

    the taxon ID



37
38
39
# File 'app/resources/v1/sample_resource.rb', line 37

attributes :name, :external_id, :species, :created_at, :deactivated_at,
:sanger_sample_id, :supplier_name, :taxon_id, :donor_id, :country_of_origin,
:accession_number, :date_of_sample_collection, :number_of_donors