Class: ProjectUsers

Inherits:
Object
  • Object
show all
Defined in:
lib/ft_42.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_users_response) ⇒ ProjectUsers

Returns a new instance of ProjectUsers.



229
230
231
232
# File 'lib/ft_42.rb', line 229

def initialize(project_users_response)
  @project_users = project_users_response
  @project_users.flatten!
end

Instance Attribute Details

#project_usersObject (readonly)

Returns the value of attribute project_users.



227
228
229
# File 'lib/ft_42.rb', line 227

def project_users
  @project_users
end

Instance Method Details

#in_progressObject



238
239
240
241
# File 'lib/ft_42.rb', line 238

def in_progress
  in_progress = project_users.select { |user_project| user_project["status"] == "in_progress" }
  in_progress.map { |user_project| user_project["user"]["login"] }
end

#loginsObject



234
235
236
# File 'lib/ft_42.rb', line 234

def logins
  project_users.map { |user_project| user_project["user"]["login"] }
end