Class: KeycloakAdmin::GroupRepresentation

Inherits:
Representation show all
Defined in:
lib/keycloak-admin/representation/group_representation.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Representation

#as_json, from_json, #to_json

Methods included from CamelJson

#camelize

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/keycloak-admin/representation/group_representation.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/keycloak-admin/representation/group_representation.rb', line 3

def name
  @name
end

#pathObject

Returns the value of attribute path.



3
4
5
# File 'lib/keycloak-admin/representation/group_representation.rb', line 3

def path
  @path
end

#sub_groupsObject

Returns the value of attribute sub_groups.



3
4
5
# File 'lib/keycloak-admin/representation/group_representation.rb', line 3

def sub_groups
  @sub_groups
end

Class Method Details

.from_hash(hash) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/keycloak-admin/representation/group_representation.rb', line 8

def self.from_hash(hash)
  group            = new
  group.id         = hash["id"]
  group.name       = hash["name"]
  group.path       = hash["path"]
  group.sub_groups = hash.fetch("subGroups", []).map { |sub_group_hash| self.from_hash(sub_group_hash) }
  group
end