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