Class: RolesManagementAPI::Person

Inherits:
Object
  • Object
show all
Defined in:
lib/roles-management-api/person.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_membershipsObject

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

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/roles-management-api/person.rb', line 3

def id
  @id
end

#loginidObject

Returns the value of attribute loginid.



3
4
5
# File 'lib/roles-management-api/person.rb', line 3

def loginid
  @loginid
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/roles-management-api/person.rb', line 3

def name
  @name
end

#role_assignmentsObject

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_jsonObject



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