Class: TeamPresenter

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

Class Method Summary collapse

Class Method Details

.render_list(team) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/presenters/team_presenter.rb', line 5

def render_list(team)
  team_name = team.name.downcase
  despaced_team_name = team_name.gsub(' ', '-')
  folder_rows = team.folders.map do |folder|
    folder_name = folder.name.downcase
    "#{folder_name} (cry use #{despaced_team_name}/#{folder_name.gsub(' ', '-')})"
  end

  team_name = "#{team_name} => "
  joined_folder_rows = folder_rows.join("\n" + ' ' * team_name.length)
  team_name + joined_folder_rows
end