From e86325d6df04d4c205ef25ec2ca4a25898140692 Mon Sep 17 00:00:00 2001 From: Daniel Asher Resnick Date: Thu, 29 Dec 2022 20:00:09 -0600 Subject: [PATCH] Remove now-redundant stocks key in the data object --- src/app.rb | 6 +++--- src/lib/data/gold.rb | 1 - src/lib/data/troll.rb | 2 -- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/app.rb b/src/app.rb index 69be77b..290c391 100644 --- a/src/app.rb +++ b/src/app.rb @@ -54,7 +54,7 @@ get '/stock_objs' do end get '/lifepaths/:stock' do - if DATA[:stocks].include? params['stock'] + if DATA[:stock_objs].keys.include? params['stock'] json DATA[:lifepaths][params['stock']] else 404 @@ -62,7 +62,7 @@ get '/lifepaths/:stock' do end get '/starting_stat_pts/:stock' do - if DATA[:stocks].include? params['stock'] + if DATA[:stock_objs].keys.include? params['stock'] json DATA[:stat_pts][params['stock']] else 404 @@ -70,7 +70,7 @@ get '/starting_stat_pts/:stock' do end get '/resources/:stock' do - if DATA[:stocks].include? params['stock'] + if DATA[:stock_objs].keys.include? params['stock'] json DATA[:resources][params['stock']] else 404 diff --git a/src/lib/data/gold.rb b/src/lib/data/gold.rb index ff7ec28..6f991a0 100644 --- a/src/lib/data/gold.rb +++ b/src/lib/data/gold.rb @@ -29,7 +29,6 @@ module Charred end data.merge!({ - :stocks => stocks, :skills => skills, :traits => traits, :lifepaths => lifepaths, diff --git a/src/lib/data/troll.rb b/src/lib/data/troll.rb index a98c72d..bec97d1 100644 --- a/src/lib/data/troll.rb +++ b/src/lib/data/troll.rb @@ -4,8 +4,6 @@ require_relative '../stock' module Charred module Troll def load_troll(data) - data[:stocks] << 'troll' - file = File.read('data/troll/skills.json') skills = JSON.parse(file) verbose_merge data[:skills], skills