Class: WorkOS::AuditLogExport

Inherits:
Object
  • Object
show all
Includes:
HashProvider
Defined in:
lib/workos/audit_logs/audit_log_export.rb

Constant Summary collapse

HASH_ATTRS =
{
  object: :object,
  id: :id,
  state: :state,
  url: :url,
  created_at: :created_at,
  updated_at: :updated_at
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashProvider

#inspect, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ AuditLogExport

Returns a new instance of AuditLogExport.



28
29
30
31
32
33
34
35
36
37
# File 'lib/workos/audit_logs/audit_log_export.rb', line 28

def initialize(json)
  hash = json.is_a?(Hash) ? json : JSON.parse(json, symbolize_names: true)
  hash = hash.transform_keys(&:to_sym) if hash.keys.first.is_a?(String)
  @object = hash[:object]
  @id = hash[:id]
  @state = hash[:state]
  @url = hash[:url]
  @created_at = hash[:created_at]
  @updated_at = hash[:updated_at]
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



20
21
22
# File 'lib/workos/audit_logs/audit_log_export.rb', line 20

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



20
21
22
# File 'lib/workos/audit_logs/audit_log_export.rb', line 20

def id
  @id
end

#objectObject

Returns the value of attribute object.



20
21
22
# File 'lib/workos/audit_logs/audit_log_export.rb', line 20

def object
  @object
end

#stateObject

Returns the value of attribute state.



20
21
22
# File 'lib/workos/audit_logs/audit_log_export.rb', line 20

def state
  @state
end

#updated_atObject

Returns the value of attribute updated_at.



20
21
22
# File 'lib/workos/audit_logs/audit_log_export.rb', line 20

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



20
21
22
# File 'lib/workos/audit_logs/audit_log_export.rb', line 20

def url
  @url
end