Class: Api::V2::QcableResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::QcableResource
- Defined in:
- app/resources/api/v2/qcable_resource.rb
Overview
The below POST example is currently broken, as qcable_creator
is required in the model but it is not included in the resource.
Access this resource via the /api/v2/qcables/
endpoint.
Provides a JSON:API representation of Qcable which represents an element of a lot which needs to be approved by QC before it can be used.
For more information about JSON:API see the JSON:API Specifications or look at the JSONAPI::Resources package for Sequencescape's implementation of the JSON:API standard.
Instance Attribute Summary collapse
-
#asset ⇒ LabwareResource
deprecated
Deprecated.
Use the #labware relationship instead.
- #labware ⇒ LabwareResource
-
#labware_barcode ⇒ Hash
readonly
The barcodes of the labware associated with this Qcable.
- #lot ⇒ LotResource
-
#state ⇒ String
readonly
A string representation of the state this Qcable is in.
-
#uuid ⇒ String
readonly
The UUID of this Qcable.
Instance Method Summary collapse
-
#filter_barcode ⇒ Object
Apply a filter across all Qcable resource , matching by barcode.
-
#filter_uuid ⇒ Object
Apply a filter across all Qcable resources, matching by UUID.
Methods inherited from BaseResource
apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields
Instance Attribute Details
#asset ⇒ LabwareResource
102 |
# File 'app/resources/api/v2/qcable_resource.rb', line 102 has_one :asset |
#labware ⇒ LabwareResource
106 |
# File 'app/resources/api/v2/qcable_resource.rb', line 106 has_one :labware, relation_name: 'asset', foreign_key: :asset_id |
#labware_barcode ⇒ Hash (readonly)
Returns the barcodes of the labware associated with this Qcable. This includes the EAN13 barcode, the machine barcode and the human barcode. Note however that some of these barcodes may be nil
.
68 |
# File 'app/resources/api/v2/qcable_resource.rb', line 68 attribute :labware_barcode, readonly: true |
#lot ⇒ LotResource
110 |
# File 'app/resources/api/v2/qcable_resource.rb', line 110 has_one :lot |
#state ⇒ String (readonly)
89 |
# File 'app/resources/api/v2/qcable_resource.rb', line 89 attribute :state, readonly: true |
#uuid ⇒ String (readonly)
Returns the UUID of this Qcable.
93 |
# File 'app/resources/api/v2/qcable_resource.rb', line 93 attribute :uuid, readonly: true |
Instance Method Details
#filter_barcode ⇒ Object
Apply a filter across all Qcable resource , matching by barcode.
120 |
# File 'app/resources/api/v2/qcable_resource.rb', line 120 filter :barcode, apply: ->(records, value, ) { records.(value) } |
#filter_uuid ⇒ Object
Apply a filter across all Qcable resources, matching by UUID.
126 |
# File 'app/resources/api/v2/qcable_resource.rb', line 126 filter :uuid, apply: ->(records, value, ) { records.with_uuid(value) } |