lib/ahl_scraper/resources/seasons/team.rb in ahl_scraper-0.2.0 vs lib/ahl_scraper/resources/seasons/team.rb in ahl_scraper-0.3.0

- old
+ new

@@ -26,12 +26,12 @@ "wilkes-barre-scranton-penguins" => { city: "Wilkes-Barre/Scranton", name: "Penguins", game_file_city: "W-B/Scranton" }, "edmonton-road-runners" => { city: "Edmonton", name: "Road Runners" }, "henderson-silver-knights" => { city: "Henderson", name: "Silver Knights" }, }.freeze - def initialize(raw_data, division) - @raw_data = raw_data + def initialize(raw_data, division, opts = {}) + super(raw_data, opts) @division = division end def id @id ||= @raw_data.dig(:prop, :team_code, :teamLink)&.to_i @@ -40,10 +40,11 @@ def full_name @full_name ||= @raw_data.dig(:row, :name)&.delete_prefix("y -")&.delete_prefix("x -")&.delete_prefix("xy -")&.strip end def abbreviation - @abbreviation ||= EXCEPTIONS[parameterized_name]&.dig(:abbreviation) || @raw_data.dig(:row, :team_code)&.delete_prefix("y -")&.delete_prefix("x -")&.delete_prefix("xy -")&.strip + @abbreviation ||= EXCEPTIONS[parameterized_name]&.dig(:abbreviation) || @raw_data.dig(:row, + :team_code)&.delete_prefix("y -")&.delete_prefix("x -")&.delete_prefix("xy -")&.strip end def parameterized_name @parameterized_name ||= ParameterizeHelper.new(full_name).call end