Class: Api::V2::TubePurposeResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::TubePurposeResource
- Defined in:
- app/resources/api/v2/tube_purpose_resource.rb
Overview
Access this resource via the /api/v2/tube_purposes/
endpoint.
Provides a JSON:API representation of Tube::Purpose.
A Tube::Purpose is a base class for the all tube purposes, which describes the role the associated Tube is playing within the lab, and modifies its behaviour.
This resource allows for the management and retrieval of tube purposes.
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
-
#name ⇒ String
The name of the tube purpose, describing the intended use of the tube.
-
#purpose_type ⇒ String
This is mapped to the
type
attribute on the model. -
#target_type ⇒ String
The target type, indicating what type of tube the purpose is associated with (e.g., 'StockLibraryTube').
-
#uuid ⇒ String
readonly
The UUID of the tube purpose.
Instance Method Summary collapse
-
#filter_type ⇒ Object
Filter tube purposes by type.
Methods inherited from BaseResource
apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields
Instance Attribute Details
#name ⇒ String
This attribute is required.
Returns The name of the tube purpose, describing the intended use of the tube.
60 |
# File 'app/resources/api/v2/tube_purpose_resource.rb', line 60 attribute :name |
#purpose_type ⇒ String
This is mapped to the type
attribute on the model.
65 |
# File 'app/resources/api/v2/tube_purpose_resource.rb', line 65 attribute :purpose_type, delegate: :type |
#target_type ⇒ String
This attribute is required.
Returns The target type, indicating what type of tube the purpose is associated with (e.g., 'StockLibraryTube').
71 |
# File 'app/resources/api/v2/tube_purpose_resource.rb', line 71 attribute :target_type |
#uuid ⇒ String (readonly)
This identifier is automatically assigned upon creation and cannot be modified.
Returns The UUID of the tube purpose.
76 |
# File 'app/resources/api/v2/tube_purpose_resource.rb', line 76 attribute :uuid, readonly: true |
Instance Method Details
#filter_type ⇒ Object
Filter tube purposes by type.
86 |
# File 'app/resources/api/v2/tube_purpose_resource.rb', line 86 filter :type, default: 'Tube::Purpose' |