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.



1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
# File 'lib/models/porcelain.rb', line 1349

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_id ⇒ Object

The account responsible for the event.



1339
1340
1341
# File 'lib/models/porcelain.rb', line 1339

def actor_id
  @actor_id
end

#id ⇒ Object

The access request event id.



1341
1342
1343
# File 'lib/models/porcelain.rb', line 1341

def id
  @id
end

#metadata ⇒ Object

The metadata about the event



1343
1344
1345
# File 'lib/models/porcelain.rb', line 1343

def 
  @metadata
end

#request_id ⇒ Object

The request that the event is bound to.



1345
1346
1347
# File 'lib/models/porcelain.rb', line 1345

def request_id
  @request_id
end

#type ⇒ Object

The type of event.



1347
1348
1349
# File 'lib/models/porcelain.rb', line 1347

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1363
1364
1365
1366
1367
1368
1369
# File 'lib/models/porcelain.rb', line 1363

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