Class: Smplkit::Audit::Action

Inherits:
Struct
  • Object
show all
Defined in:
lib/smplkit/audit/models.rb

Overview

A distinct action slug seen for the account.

Same shape as ResourceTypeid and action 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 (action, resource_type) triple, not the action overall.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#actionObject

Returns the value of attribute action

Returns:

  • (Object)

    the current value of action



116
117
118
# File 'lib/smplkit/audit/models.rb', line 116

def action
  @action
end

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



116
117
118
# File 'lib/smplkit/audit/models.rb', line 116

def created_at
  @created_at
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



116
117
118
# File 'lib/smplkit/audit/models.rb', line 116

def id
  @id
end

Class Method Details

.from_resource(resource) ⇒ Object



117
118
119
120
121
122
123
124
# File 'lib/smplkit/audit/models.rb', line 117

def self.from_resource(resource)
  attrs = resource.attributes
  new(
    id: resource.id,
    action: attrs.action || resource.id,
    created_at: attrs.created_at
  )
end