Class: WorkOS::AuditLogsRetention

Inherits:
Object
  • Object
show all
Includes:
HashProvider
Defined in:
lib/workos/organizations/audit_logs_retention.rb

Constant Summary collapse

HASH_ATTRS =
{
  retention_period_in_days: :retention_period_in_days
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashProvider

#inspect, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ AuditLogsRetention

Returns a new instance of AuditLogsRetention.



17
18
19
20
21
# File 'lib/workos/organizations/audit_logs_retention.rb', line 17

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)
  @retention_period_in_days = hash[:retention_period_in_days]
end

Instance Attribute Details

#retention_period_in_daysObject

Returns the value of attribute retention_period_in_days.



15
16
17
# File 'lib/workos/organizations/audit_logs_retention.rb', line 15

def retention_period_in_days
  @retention_period_in_days
end