Class: Smplkit::Audit::ResourceType
- Inherits:
-
Struct
- Object
- Struct
- Smplkit::Audit::ResourceType
- Defined in:
- lib/smplkit/audit/models.rb
Overview
A distinct resource_type slug seen for the account.
The id and resource_type are the same value — JSON:API surfaces the customer-facing key as the resource id (ADR-014). The duplication keeps SDK consumers from having to dig into the id field when filtering UI controls; pick whichever name reads better in context.
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#resource_type ⇒ Object
Returns the value of attribute resource_type.
Class Method Summary collapse
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at
99 100 101 |
# File 'lib/smplkit/audit/models.rb', line 99 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id
99 100 101 |
# File 'lib/smplkit/audit/models.rb', line 99 def id @id end |
#resource_type ⇒ Object
Returns the value of attribute resource_type
99 100 101 |
# File 'lib/smplkit/audit/models.rb', line 99 def resource_type @resource_type end |
Class Method Details
.from_resource(resource) ⇒ Object
100 101 102 103 104 105 106 107 |
# File 'lib/smplkit/audit/models.rb', line 100 def self.from_resource(resource) attrs = resource.attributes new( id: resource.id, resource_type: attrs.resource_type || resource.id, created_at: attrs.created_at ) end |