Class: SDM::AccessRequestEvent

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

Overview

AccessRequestEvents hold information about events related to an access request such as creation, approval and denial.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(actor_id: nil, id: nil, metadata: nil, request_id: nil, type: nil) ⇒ AccessRequestEvent

Returns a new instance of AccessRequestEvent.



1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
# File 'lib/models/porcelain.rb', line 1035

def initialize(
  actor_id: nil,
  id: nil,
  metadata: nil,
  request_id: nil,
  type: nil
)
  @actor_id = actor_id == nil ? "" : actor_id
  @id = id == nil ? "" : id
  @metadata =  == nil ? "" : 
  @request_id = request_id == nil ? "" : request_id
  @type = type == nil ? "" : type
end

Instance Attribute Details

#actor_idObject

The account responsible for the event.



1025
1026
1027
# File 'lib/models/porcelain.rb', line 1025

def actor_id
  @actor_id
end

#idObject

The access request event id.



1027
1028
1029
# File 'lib/models/porcelain.rb', line 1027

def id
  @id
end

#metadataObject

The metadata about the event



1029
1030
1031
# File 'lib/models/porcelain.rb', line 1029

def 
  @metadata
end

#request_idObject

The request that the event is bound to.



1031
1032
1033
# File 'lib/models/porcelain.rb', line 1031

def request_id
  @request_id
end

#typeObject

The type of event.



1033
1034
1035
# File 'lib/models/porcelain.rb', line 1033

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1049
1050
1051
1052
1053
1054
1055
# File 'lib/models/porcelain.rb', line 1049

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