Class: Api::V2::QcableResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::QcableResource
- Defined in:
- app/resources/api/v2/qcable_resource.rb
Overview
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
99 |
# File 'app/resources/api/v2/qcable_resource.rb', line 99 has_one :asset |
#labware ⇒ LabwareResource
103 |
# File 'app/resources/api/v2/qcable_resource.rb', line 103 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
.
65 |
# File 'app/resources/api/v2/qcable_resource.rb', line 65 attribute :labware_barcode, readonly: true |
#lot ⇒ LotResource
107 |
# File 'app/resources/api/v2/qcable_resource.rb', line 107 has_one :lot |
#state ⇒ String (readonly)
86 |
# File 'app/resources/api/v2/qcable_resource.rb', line 86 attribute :state, readonly: true |
#uuid ⇒ String (readonly)
Returns the UUID of this Qcable.
90 |
# File 'app/resources/api/v2/qcable_resource.rb', line 90 attribute :uuid, readonly: true |
Instance Method Details
#filter_barcode ⇒ Object
Apply a filter across all Qcable resource , matching by barcode.
117 |
# File 'app/resources/api/v2/qcable_resource.rb', line 117 filter :barcode, apply: ->(records, value, ) { records.(value) } |
#filter_uuid ⇒ Object
Apply a filter across all Qcable resources, matching by UUID.
123 |
# File 'app/resources/api/v2/qcable_resource.rb', line 123 filter :uuid, apply: ->(records, value, ) { records.with_uuid(value) } |