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.



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

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.



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

def activity_id
  @activity_id
end

#deleted_at ⇒ Object

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



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

def deleted_at
  @deleted_at
end

#group_role ⇒ Object

The complete GroupRole state at this time.



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

def group_role
  @group_role
end

#timestamp ⇒ Object

The time at which the GroupRole state was recorded.



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

def timestamp
  @timestamp
end

Instance Method Details

#to_json(options = {}) ⇒ Object



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

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