Class: Api::V2::TubeRackPurposeResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::TubeRackPurposeResource
- Defined in:
- app/resources/api/v2/tube_rack_purpose_resource.rb
Overview
Access this resource via the /api/v2/tube_rack_purposes/
endpoint.
This resource represents the API structure for the TubeRack::Purpose model. This purpose is used by Limber for config generation.
Provides a JSON:API representation of TubeRack::Purpose.
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 rack purpose.
-
#purpose_type ⇒ String
The purpose type.
-
#size ⇒ Integer
The size of the tube rack purpose.
-
#target_type ⇒ String
The target type.
-
#uuid ⇒ String
readonly
The UUID of the tube rack purpose.
Class Method Summary collapse
-
.creatable_fields(_context) ⇒ Array<Symbol>
Gets the list of fields which are creatable on a TubeRackPurpose.
-
.updatable_fields(_context) ⇒ Array<Symbol>
Gets the list of fields which are updatable on an existing TubeRackPurpose.
Methods inherited from BaseResource
apply_includes, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations
Instance Attribute Details
#name ⇒ String
Returns the name of the tube rack purpose.
24 |
# File 'app/resources/api/v2/tube_rack_purpose_resource.rb', line 24 attribute :name |
#purpose_type ⇒ String
Returns the purpose type. This is mapped to the type attribute on the model.
32 |
# File 'app/resources/api/v2/tube_rack_purpose_resource.rb', line 32 attribute :purpose_type, delegate: :type |
#size ⇒ Integer
Returns the size of the tube rack purpose.
28 |
# File 'app/resources/api/v2/tube_rack_purpose_resource.rb', line 28 attribute :size |
#target_type ⇒ String
Returns the target type.
36 |
# File 'app/resources/api/v2/tube_rack_purpose_resource.rb', line 36 attribute :target_type |
#uuid ⇒ String (readonly)
Returns the UUID of the tube rack purpose.
40 |
# File 'app/resources/api/v2/tube_rack_purpose_resource.rb', line 40 attribute :uuid, readonly: true |
Class Method Details
.creatable_fields(_context) ⇒ Array<Symbol>
Gets the list of fields which are creatable on a TubeRackPurpose.
46 47 48 |
# File 'app/resources/api/v2/tube_rack_purpose_resource.rb', line 46 def self.creatable_fields(_context) super - %i[uuid] # Do not allow creating with any readonly fields end |
.updatable_fields(_context) ⇒ Array<Symbol>
Gets the list of fields which are updatable on an existing TubeRackPurpose.
54 55 56 |
# File 'app/resources/api/v2/tube_rack_purpose_resource.rb', line 54 def self.updatable_fields(_context) super - %i[uuid] # Do not allow creating with any readonly fields end |