Class: Smplkit::Audit::EventType
- Inherits:
-
Struct
- Object
- Struct
- Smplkit::Audit::EventType
- Defined in:
- lib/smplkit/audit/models.rb
Overview
A distinct event_type slug seen for the account.
Same shape as ResourceType — id and event_type are the same value. created_at is the earliest sighting; when the parent list call filtered by resource_type, this is the first sighting of that specific (event_type, resource_type) triple, not the event type overall.
Instance Attribute Summary collapse
-
#created_at ⇒ String
ISO-8601 timestamp of the earliest sighting for this slug.
-
#event_type ⇒ String
The distinct event type slug.
-
#id ⇒ String
JSON:API resource id (same as
event_type).
Class Method Summary collapse
Instance Attribute Details
#created_at ⇒ String
Returns ISO-8601 timestamp of the earliest sighting for this slug.
231 232 233 234 235 236 237 238 239 240 |
# File 'lib/smplkit/audit/models.rb', line 231 EventType = Struct.new(:id, :event_type, :created_at, keyword_init: true) do def self.from_resource(resource) attrs = resource.attributes new( id: resource.id, event_type: attrs.event_type || resource.id, created_at: attrs.created_at ) end end |
#event_type ⇒ String
Returns The distinct event type slug.
231 232 233 234 235 236 237 238 239 240 |
# File 'lib/smplkit/audit/models.rb', line 231 EventType = Struct.new(:id, :event_type, :created_at, keyword_init: true) do def self.from_resource(resource) attrs = resource.attributes new( id: resource.id, event_type: attrs.event_type || resource.id, created_at: attrs.created_at ) end end |
#id ⇒ String
Returns JSON:API resource id (same as event_type).
231 232 233 234 235 236 237 238 239 240 |
# File 'lib/smplkit/audit/models.rb', line 231 EventType = Struct.new(:id, :event_type, :created_at, keyword_init: true) do def self.from_resource(resource) attrs = resource.attributes new( id: resource.id, event_type: attrs.event_type || resource.id, created_at: attrs.created_at ) end end |
Class Method Details
.from_resource(resource) ⇒ Object
232 233 234 235 236 237 238 239 |
# File 'lib/smplkit/audit/models.rb', line 232 def self.from_resource(resource) attrs = resource.attributes new( id: resource.id, event_type: attrs.event_type || resource.id, created_at: attrs.created_at ) end |