Skip to content

Commit

Permalink
put all GDTs at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
Fustrate committed Apr 2, 2024
1 parent 4e148e9 commit 29f1b3f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions scripts/around_the_horn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,18 @@ def todays_games_row(game)
]
end

# abbreviation:, subreddit:, post_id:, link:, score:
def team_link(team)
return "[#{team[:abbreviation]}](/#{team[:post_id]} \"team-#{team[:abbreviation].downcase}\")" if team[:post_id]

"[#{team[:abbreviation]}](/r/#{team[:subreddit]})"
def gdt_links(game)
[
gdt_link(game[:away]),
gdt_link(game[:home]),
gdt_link(game[:neutral], name: 'Neutral')
].compact.join(', ')
end

def gdt_link(team, name: nil) = ("[#{name || team[:abbreviation]}](/r/#{team[:post_id]})" if team[:post_id])

# abbreviation:, subreddit:, post_id:, link:, score:
def team_link(team) = "[#{team[:abbreviation]}](/r/#{team[:subreddit]})"
end

def initialize
Expand Down

0 comments on commit 29f1b3f

Please sign in to comment.