Class: SDM::GroupRoleHistory

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(activity_id: nil, deleted_at: nil, group_role: nil, timestamp: nil) ⇒ GroupRoleHistory

Returns a new instance of GroupRoleHistory.



8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
# File 'lib/models/porcelain.rb', line 8885

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

Instance Attribute Details

#activity_id ⇒ Object

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



8877
8878
8879
# File 'lib/models/porcelain.rb', line 8877

def activity_id
  @activity_id
end

#deleted_at ⇒ Object

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



8879
8880
8881
# File 'lib/models/porcelain.rb', line 8879

def deleted_at
  @deleted_at
end

#group_role ⇒ Object

The complete GroupRole state at this time.



8881
8882
8883
# File 'lib/models/porcelain.rb', line 8881

def group_role
  @group_role
end

#timestamp ⇒ Object

The time at which the GroupRole state was recorded.



8883
8884
8885
# File 'lib/models/porcelain.rb', line 8883

def timestamp
  @timestamp
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8897
8898
8899
8900
8901
8902
8903
# File 'lib/models/porcelain.rb', line 8897

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