From 919625feb78d2f6409a5ff82c7d6a5b5268fda05 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 16 Aug 2023 02:54:12 -0700 Subject: [PATCH] Update character parser to use correct vars --- app/helpers/character_parser.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/helpers/character_parser.rb b/app/helpers/character_parser.rb index a3c48ad..f4361bf 100644 --- a/app/helpers/character_parser.rb +++ b/app/helpers/character_parser.rb @@ -35,10 +35,10 @@ class CharacterParser @character.wiki_en = redirect if @character.save! - ap "Saved new wiki_en value for #{@granblue_id}: #{redirect}" if @debug + ap "Saved new wiki_en value for #{@character.granblue_id}: #{redirect}" if @debug redirect else - ap "Unable to save new wiki_en value for #{@granblue_id}: #{redirect}" if @debug + ap "Unable to save new wiki_en value for #{@character.granblue_id}: #{redirect}" if @debug nil end end @@ -46,7 +46,7 @@ class CharacterParser # Handle the response from the wiki if the response is successful # If the save flag is set, it will persist the data to the database def handle_fetch_success(response, save) - ap "#{@granblue_id}: Successfully fetched info for #{@character.wiki_en}" if @debug + ap "#{@character.granblue_id}: Successfully fetched info for #{@character.wiki_en}" if @debug extracted = parse_string(response) info = parse(extracted) persist(info) if save @@ -180,8 +180,8 @@ class CharacterParser end # Converts proficiencies from a string to a hash - def proficiencies_from_hash(weapon) - weapon.to_s.split(',').map.with_index do |prof, i| + def proficiencies_from_hash(character) + character.to_s.split(',').map.with_index do |prof, i| { "proficiency#{i + 1}" => GranblueWiki.proficiencies[prof] } end.reduce({}, :merge) end