Class: KeycloakAdmin::GroupRepresentation
- Inherits:
-
Representation
- Object
- Representation
- KeycloakAdmin::GroupRepresentation
- Defined in:
- lib/keycloak-admin/representation/group_representation.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#sub_group_count ⇒ Object
Returns the value of attribute sub_group_count.
-
#sub_groups ⇒ Object
Returns the value of attribute sub_groups.
Class Method Summary collapse
Methods inherited from Representation
Methods included from CamelJson
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/keycloak-admin/representation/group_representation.rb', line 3 def attributes @attributes end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/keycloak-admin/representation/group_representation.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/keycloak-admin/representation/group_representation.rb', line 3 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/keycloak-admin/representation/group_representation.rb', line 3 def path @path end |
#sub_group_count ⇒ Object
Returns the value of attribute sub_group_count.
3 4 5 |
# File 'lib/keycloak-admin/representation/group_representation.rb', line 3 def sub_group_count @sub_group_count end |
#sub_groups ⇒ Object
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
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/keycloak-admin/representation/group_representation.rb', line 10 def self.from_hash(hash) group = new group.id = hash["id"] group.name = hash["name"] group.path = hash["path"] group.attributes = hash.fetch("attributes", {}).map { |k, v| [k.to_sym, Array(v)] }.to_h group.sub_group_count = hash["subGroupCount"] group.sub_groups = hash.fetch("subGroups", []).map { |sub_group_hash| self.from_hash(sub_group_hash) } group end |