Class: WorkOS::AuditLogSchema
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- WorkOS::AuditLogSchema
- Defined in:
- lib/workos/audit_logs/audit_log_schema.rb
Constant Summary collapse
- HASH_ATTRS =
{ actor: :actor, targets: :targets, metadata: :metadata }.freeze
Instance Attribute Summary collapse
-
#actor ⇒ Object
Returns the value of attribute actor.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#targets ⇒ Object
Returns the value of attribute targets.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ AuditLogSchema
constructor
A new instance of AuditLogSchema.
Methods inherited from Types::BaseModel
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ AuditLogSchema
Returns a new instance of AuditLogSchema.
18 19 20 21 22 23 |
# File 'lib/workos/audit_logs/audit_log_schema.rb', line 18 def initialize(json) hash = self.class.normalize(json) @actor = hash[:actor] ? WorkOS::AuditLogSchemaActor.new(hash[:actor]) : nil @targets = (hash[:targets] || []).map { |item| item ? WorkOS::AuditLogSchemaTarget.new(item) : nil } @metadata = hash[:metadata] || {} end |
Instance Attribute Details
#actor ⇒ Object
Returns the value of attribute actor.
13 14 15 |
# File 'lib/workos/audit_logs/audit_log_schema.rb', line 13 def actor @actor end |
#metadata ⇒ Object
Returns the value of attribute metadata.
13 14 15 |
# File 'lib/workos/audit_logs/audit_log_schema.rb', line 13 def @metadata end |
#targets ⇒ Object
Returns the value of attribute targets.
13 14 15 |
# File 'lib/workos/audit_logs/audit_log_schema.rb', line 13 def targets @targets end |