Class: SDM::ApprovalWorkflowHistory

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(activity_id: nil, approval_workflow: nil, deleted_at: nil, timestamp: nil) ⇒ ApprovalWorkflowHistory

Returns a new instance of ApprovalWorkflowHistory.



3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
# File 'lib/models/porcelain.rb', line 3008

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

Instance Attribute Details

#activity_idObject

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



3000
3001
3002
# File 'lib/models/porcelain.rb', line 3000

def activity_id
  @activity_id
end

#approval_workflowObject

The complete ApprovalWorkflow state at this time.



3002
3003
3004
# File 'lib/models/porcelain.rb', line 3002

def approval_workflow
  @approval_workflow
end

#deleted_atObject

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



3004
3005
3006
# File 'lib/models/porcelain.rb', line 3004

def deleted_at
  @deleted_at
end

#timestampObject

The time at which the ApprovalWorkflow state was recorded.



3006
3007
3008
# File 'lib/models/porcelain.rb', line 3006

def timestamp
  @timestamp
end

Instance Method Details

#to_json(options = {}) ⇒ Object



3020
3021
3022
3023
3024
3025
3026
# File 'lib/models/porcelain.rb', line 3020

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