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.



1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
# File 'lib/models/porcelain.rb', line 1731

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.



1722
1723
1724
# File 'lib/models/porcelain.rb', line 1722

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.



1725
1726
1727
# File 'lib/models/porcelain.rb', line 1725

def activity_id
  @activity_id
end

#deleted_atObject

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



1727
1728
1729
# File 'lib/models/porcelain.rb', line 1727

def deleted_at
  @deleted_at
end

#timestampObject

The time at which the AccountGroup state was recorded.



1729
1730
1731
# File 'lib/models/porcelain.rb', line 1729

def timestamp
  @timestamp
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1743
1744
1745
1746
1747
1748
1749
# File 'lib/models/porcelain.rb', line 1743

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