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.



869
870
871
872
873
874
875
876
877
878
879
880
881
# File 'lib/models/porcelain.rb', line 869

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
   =  == nil ? "" : 
  @request_id = request_id == nil ? "" : request_id
  @type = type == nil ? "" : type
end

Instance Attribute Details

#actor_idObject

The account responsible for the event.



859
860
861
# File 'lib/models/porcelain.rb', line 859

def actor_id
  @actor_id
end

#idObject

The access request event id.



861
862
863
# File 'lib/models/porcelain.rb', line 861

def id
  @id
end

#metadataObject

The metadata about the event



863
864
865
# File 'lib/models/porcelain.rb', line 863

def 
  
end

#request_idObject

The request that the event is bound to.



865
866
867
# File 'lib/models/porcelain.rb', line 865

def request_id
  @request_id
end

#typeObject

The type of event.



867
868
869
# File 'lib/models/porcelain.rb', line 867

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



883
884
885
886
887
888
889
# File 'lib/models/porcelain.rb', line 883

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