Class: CrewCheck::TeamList
- Inherits:
-
Object
- Object
- CrewCheck::TeamList
- Includes:
- Enumerable
- Defined in:
- lib/crew_check/team_list.rb
Class Method Summary collapse
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(github_teams = []) ⇒ TeamList
constructor
A new instance of TeamList.
- #shorthand_names ⇒ Object
Constructor Details
Class Method Details
.fetch(token) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/crew_check/team_list.rb', line 22 def fetch(token) with_octo_auto_pagination do client = Octokit::Client.new(access_token: token) new(client.user_teams) end end |
Instance Method Details
#each(&block) ⇒ Object
30 31 32 |
# File 'lib/crew_check/team_list.rb', line 30 def each(&block) @teams.each(&block) end |
#empty? ⇒ Boolean
34 35 36 |
# File 'lib/crew_check/team_list.rb', line 34 def empty? @teams.size == 0 end |
#shorthand_names ⇒ Object
15 16 17 18 19 |
# File 'lib/crew_check/team_list.rb', line 15 def shorthand_names @teams.map do |team| team.shorthand_name end end |