Class: Entitlements::Backend::GitHubTeam::Models::Team

Inherits:
Models::Group
  • Object
show all
Includes:
Contracts::Core
Defined in:
lib/entitlements/backend/github_team/models/team.rb

Constant Summary collapse

C =
::Contracts

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(team_id:, team_name:, members:, ou:, metadata:) ⇒ Team

Returns a new instance of Team.



26
27
28
29
30
31
# File 'lib/entitlements/backend/github_team/models/team.rb', line 26

def initialize(team_id:, team_name:, members:, ou:, metadata:)
  @team_id = team_id
  @team_name = team_name.downcase
  @team_dn = ["cn=#{team_name.downcase}", ou].join(",")
  super(dn: @team_dn, members: Set.new(members.map { |m| m.downcase }), metadata:)
end

Instance Attribute Details

#team_dnObject (readonly)

Returns the value of attribute team_dn.



11
12
13
# File 'lib/entitlements/backend/github_team/models/team.rb', line 11

def team_dn
  @team_dn
end

#team_idObject (readonly)

Returns the value of attribute team_id.



11
12
13
# File 'lib/entitlements/backend/github_team/models/team.rb', line 11

def team_id
  @team_id
end

#team_nameObject (readonly)

Returns the value of attribute team_name.



11
12
13
# File 'lib/entitlements/backend/github_team/models/team.rb', line 11

def team_name
  @team_name
end