Class: V1::Ont::LibraryResource

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

Overview

Note:

Access this resource via the /v1/ont/libraries/ endpoint.

Provides a JSON:API representation of Ont::Library.

Primary relationships: * request RequestResource * tube TubeResource * pool PoolResource * tag TagResource * source_plate PlateResource * source_tube TubeResource * source_well WellResource * primary_aliquot AliquotResource * used_aliquots AliquotResource

Examples:

curl -X GET http://localhost:3100/v1/ont/libraries

curl -X PATCH "http://localhost:3100/v1/ont/libraries/1"
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
   -d '{
      "data": {
        "type": "libraries",
        "id": "1",
        "attributes": {
          "volume": 5.0,
        }
      }
    }'

curl -X DELETE "http://localhost:3100/v1/ont/libraries/1"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#concentrationFloat

Returns the concentration of the library.

Returns:

  • (Float)

    the concentration of the library



55
56
# File 'app/resources/v1/ont/library_resource.rb', line 55

attributes :volume, :kit_barcode, :concentration, :insert_size,
:created_at, :deactivated_at, :state

#created_atString

Returns the creation timestamp of the library.

Returns:

  • (String)

    the creation timestamp of the library



55
56
# File 'app/resources/v1/ont/library_resource.rb', line 55

attributes :volume, :kit_barcode, :concentration, :insert_size,
:created_at, :deactivated_at, :state

#deactivated_atString?

Returns the deactivation timestamp of the library, if any.

Returns:

  • (String, nil)

    the deactivation timestamp of the library, if any



55
56
# File 'app/resources/v1/ont/library_resource.rb', line 55

attributes :volume, :kit_barcode, :concentration, :insert_size,
:created_at, :deactivated_at, :state

#insert_sizeInteger

Returns the insert size of the library.

Returns:

  • (Integer)

    the insert size of the library



55
56
# File 'app/resources/v1/ont/library_resource.rb', line 55

attributes :volume, :kit_barcode, :concentration, :insert_size,
:created_at, :deactivated_at, :state

#kit_barcodeString

Returns the barcode of the kit used.

Returns:

  • (String)

    the barcode of the kit used



55
56
# File 'app/resources/v1/ont/library_resource.rb', line 55

attributes :volume, :kit_barcode, :concentration, :insert_size,
:created_at, :deactivated_at, :state

#stateString

Returns the state of the library.

Returns:

  • (String)

    the state of the library



55
56
# File 'app/resources/v1/ont/library_resource.rb', line 55

attributes :volume, :kit_barcode, :concentration, :insert_size,
:created_at, :deactivated_at, :state

#volumeFloat

Returns the volume of the library.

Returns:

  • (Float)

    the volume of the library



55
56
# File 'app/resources/v1/ont/library_resource.rb', line 55

attributes :volume, :kit_barcode, :concentration, :insert_size,
:created_at, :deactivated_at, :state

Class Method Details

.records_for_populate(*_args) ⇒ Object



72
73
74
75
76
# File 'app/resources/v1/ont/library_resource.rb', line 72

def self.records_for_populate(*_args)
  super.preload(source_well: :plate, request: :sample,
                tag: :tag_set,
                container_material: { container: :barcode })
end