Class: DeployGate::Xcode::LocalTeams
- Inherits:
-
Object
- Object
- DeployGate::Xcode::LocalTeams
- Defined in:
- lib/deploygate/xcode/local_teams.rb
Instance Method Summary collapse
- #add(id, name, profile_path) ⇒ void
- #first_team_profile_paths ⇒ Array<String>
-
#initialize ⇒ LocalTeams
constructor
A new instance of LocalTeams.
- #profile_paths(id) ⇒ Array<String>
-
#teams ⇒ Array<Hash>
[ xxxx, name: xxxxx, xxxx, name: xxxxx ].
- #teams_count ⇒ Fixnum
Constructor Details
#initialize ⇒ LocalTeams
Returns a new instance of LocalTeams.
5 6 7 8 9 |
# File 'lib/deploygate/xcode/local_teams.rb', line 5 def initialize @team_ids = [] @team_names = [] @team_profile_paths = {} end |
Instance Method Details
#add(id, name, profile_path) ⇒ void
This method returns an undefined value.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/deploygate/xcode/local_teams.rb', line 15 def add(id, name, profile_path) unless @team_ids.include?(id) @team_ids.push(id) @team_names.push(name) @team_profile_paths[id] = [] end @team_profile_paths[id].push(profile_path) unless @team_profile_paths.include?(profile_path) end |
#first_team_profile_paths ⇒ Array<String>
32 33 34 35 |
# File 'lib/deploygate/xcode/local_teams.rb', line 32 def first_team_profile_paths return [] if @team_ids.empty? profile_paths(@team_ids.first) end |
#profile_paths(id) ⇒ Array<String>
53 54 55 56 57 |
# File 'lib/deploygate/xcode/local_teams.rb', line 53 def profile_paths(id) return [] unless @team_ids.include?(id) @team_profile_paths[id] end |
#teams ⇒ Array<Hash>
[
{id: xxxx, name: xxxxx},
{id: xxxx, name: xxxxx}
]
44 45 46 47 48 49 |
# File 'lib/deploygate/xcode/local_teams.rb', line 44 def teams teams = [] @team_ids.each_with_index{|id, index| teams.push({id: id, name: @team_names[index]})} teams end |
#teams_count ⇒ Fixnum
27 28 29 |
# File 'lib/deploygate/xcode/local_teams.rb', line 27 def teams_count @team_ids.count end |