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.
13012 13013 13014 13015 13016 13017 13018 13019 13020 |
# File 'lib/models/porcelain.rb', line 13012 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.
13006 13007 13008 |
# File 'lib/models/porcelain.rb', line 13006 def granted_at @granted_at end |
#resource_id ⇒ Object
The unique identifier of the Resource to which access is granted.
13008 13009 13010 |
# File 'lib/models/porcelain.rb', line 13008 def resource_id @resource_id end |
#role_id ⇒ Object
The unique identifier of the Role to which access is granted.
13010 13011 13012 |
# File 'lib/models/porcelain.rb', line 13010 def role_id @role_id end |
Instance Method Details
#to_json(options = {}) ⇒ Object
13022 13023 13024 13025 13026 13027 13028 |
# File 'lib/models/porcelain.rb', line 13022 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 |