Class: Api::V2::CommentResource
- Inherits:
-
BaseResource
- Object
- JSONAPI::Resource
- BaseResource
- Api::V2::CommentResource
- Defined in:
- app/resources/api/v2/comment_resource.rb
Overview
Access this resource via the /api/v2/comments/
endpoint.
Provides a JSON:API representation of Comment, which represents user-generated comments on various entities.
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
-
#commentable ⇒ ApplicationResource
This is a polymorphic association, meaning it can be linked to multiple different models.
-
#created_at ⇒ DateTime
readonly
The timestamp when the comment was created.
-
#description ⇒ String
The main content of the comment.
-
#title ⇒ String
The title of the comment.
-
#updated_at ⇒ DateTime
readonly
The timestamp when the comment was last updated.
-
#user ⇒ UserResource
The user who created the comment.
Method Summary
Methods inherited from BaseResource
apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields
Instance Attribute Details
#commentable ⇒ ApplicationResource
This relationship is required.
This is a polymorphic association, meaning it can be linked to multiple different models.
53 |
# File 'app/resources/api/v2/comment_resource.rb', line 53 has_one :commentable, polymorphic: true |
#created_at ⇒ DateTime (readonly)
This attribute is read-only.
Returns The timestamp when the comment was created.
74 |
# File 'app/resources/api/v2/comment_resource.rb', line 74 attribute :created_at, readonly: true |
#description ⇒ String
This attribute is required.
This attribute is write_once; this attribute cannot be updated.
Returns The main content of the comment.
69 |
# File 'app/resources/api/v2/comment_resource.rb', line 69 attribute :description, write_once: true |
#title ⇒ String
This attribute is required.
This attribute is write_once; this attribute cannot be updated.
Returns The title of the comment.
63 |
# File 'app/resources/api/v2/comment_resource.rb', line 63 attribute :title, write_once: true |
#updated_at ⇒ DateTime (readonly)
This attribute is read-only.
Returns The timestamp when the comment was last updated.
79 |
# File 'app/resources/api/v2/comment_resource.rb', line 79 attribute :updated_at, readonly: true |
#user ⇒ UserResource
Returns The user who created the comment.
47 |
# File 'app/resources/api/v2/comment_resource.rb', line 47 has_one :user |