Class: RolesManagementAPI::RoleAssignment
- Inherits:
-
Object
- Object
- RolesManagementAPI::RoleAssignment
- Defined in:
- lib/roles-management-api/role_assignment.rb
Instance Attribute Summary collapse
-
#destroy ⇒ Object
Returns the value of attribute destroy.
-
#entity_id ⇒ Object
Returns the value of attribute entity_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#role_id ⇒ Object
Returns the value of attribute role_id.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(json) ⇒ RoleAssignment
constructor
Creates a new Person object from a JSON object.
Constructor Details
#initialize(json) ⇒ RoleAssignment
Creates a new Person object from a JSON object
6 7 8 9 10 11 |
# File 'lib/roles-management-api/role_assignment.rb', line 6 def initialize(json) @id = json[:id] @entity_id = json[:entity_id] @role_id = json[:role_id] @destroy = false end |
Instance Attribute Details
#destroy ⇒ Object
Returns the value of attribute destroy.
3 4 5 |
# File 'lib/roles-management-api/role_assignment.rb', line 3 def destroy @destroy end |
#entity_id ⇒ Object
Returns the value of attribute entity_id.
3 4 5 |
# File 'lib/roles-management-api/role_assignment.rb', line 3 def entity_id @entity_id end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/roles-management-api/role_assignment.rb', line 3 def id @id end |
#role_id ⇒ Object
Returns the value of attribute role_id.
3 4 5 |
# File 'lib/roles-management-api/role_assignment.rb', line 3 def role_id @role_id end |
Instance Method Details
#as_json ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/roles-management-api/role_assignment.rb', line 13 def as_json json = {} json['_destroy'] = true if @destroy json.merge({ id: @id, entity_id: @entity_id, role_id: @role_id }) end |