Class: SDM::AccountGroupHistory

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

AccountGroupHistory records the state of an AccountGroup at a given point in time, where every change (create, update and delete) to an AccountGroup produces an AccountGroupHistory record.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_group: nil, activity_id: nil, deleted_at: nil, timestamp: nil) ⇒ AccountGroupHistory

Returns a new instance of AccountGroupHistory.



2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
# File 'lib/models/porcelain.rb', line 2053

def initialize(
  account_group: nil,
  activity_id: nil,
  deleted_at: nil,
  timestamp: nil
)
  @account_group =  == nil ? nil : 
  @activity_id = activity_id == nil ? "" : activity_id
  @deleted_at = deleted_at == nil ? nil : deleted_at
  @timestamp = timestamp == nil ? nil : timestamp
end

Instance Attribute Details

#account_groupObject

The complete AccountGroup state at this time.



2044
2045
2046
# File 'lib/models/porcelain.rb', line 2044

def 
  @account_group
end

#activity_idObject

The unique identifier of the Activity that produced this change to the AccountGroup. May be empty for some system-initiated updates.



2047
2048
2049
# File 'lib/models/porcelain.rb', line 2047

def activity_id
  @activity_id
end

#deleted_atObject

If this AccountGroup was deleted, the time it was deleted.



2049
2050
2051
# File 'lib/models/porcelain.rb', line 2049

def deleted_at
  @deleted_at
end

#timestampObject

The time at which the AccountGroup state was recorded.



2051
2052
2053
# File 'lib/models/porcelain.rb', line 2051

def timestamp
  @timestamp
end

Instance Method Details

#to_json(options = {}) ⇒ Object



2065
2066
2067
2068
2069
2070
2071
# File 'lib/models/porcelain.rb', line 2065

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end