Class: SDM::RoleResource
- Inherits:
-
Object
- Object
- SDM::RoleResource
- Defined in:
- lib/models/porcelain.rb
Overview
RoleResource represents an individual access grant of a Role to a Resource.
Instance Attribute Summary collapse
-
#granted_at ⇒ Object
The most recent time at which access was granted.
-
#resource_id ⇒ Object
The unique identifier of the Resource to which access is granted.
-
#role_id ⇒ Object
The unique identifier of the Role to which access is granted.
Instance Method Summary collapse
-
#initialize(granted_at: nil, resource_id: nil, role_id: nil) ⇒ RoleResource
constructor
A new instance of RoleResource.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(granted_at: nil, resource_id: nil, role_id: nil) ⇒ RoleResource
Returns a new instance of RoleResource.
10855 10856 10857 10858 10859 10860 10861 10862 10863 |
# File 'lib/models/porcelain.rb', line 10855 def initialize( granted_at: nil, resource_id: nil, role_id: nil ) @granted_at = granted_at == nil ? nil : granted_at @resource_id = resource_id == nil ? "" : resource_id @role_id = role_id == nil ? "" : role_id end |
Instance Attribute Details
#granted_at ⇒ Object
The most recent time at which access was granted. If access was granted, revoked, and granted again, this will reflect the later time.
10849 10850 10851 |
# File 'lib/models/porcelain.rb', line 10849 def granted_at @granted_at end |
#resource_id ⇒ Object
The unique identifier of the Resource to which access is granted.
10851 10852 10853 |
# File 'lib/models/porcelain.rb', line 10851 def resource_id @resource_id end |
#role_id ⇒ Object
The unique identifier of the Role to which access is granted.
10853 10854 10855 |
# File 'lib/models/porcelain.rb', line 10853 def role_id @role_id end |
Instance Method Details
#to_json(options = {}) ⇒ Object
10865 10866 10867 10868 10869 10870 10871 |
# File 'lib/models/porcelain.rb', line 10865 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |