Remove now-redundant stocks key in the data object

Daniel Asher Resnick 2 years ago
parent 6e3ba97f57
commit e86325d6df
  1. 6
      src/app.rb
  2. 1
      src/lib/data/gold.rb
  3. 2
      src/lib/data/troll.rb

@ -54,7 +54,7 @@ get '/stock_objs' do
end end
get '/lifepaths/:stock' do get '/lifepaths/:stock' do
if DATA[:stocks].include? params['stock'] if DATA[:stock_objs].keys.include? params['stock']
json DATA[:lifepaths][params['stock']] json DATA[:lifepaths][params['stock']]
else else
404 404
@ -62,7 +62,7 @@ get '/lifepaths/:stock' do
end end
get '/starting_stat_pts/:stock' do 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']] json DATA[:stat_pts][params['stock']]
else else
404 404
@ -70,7 +70,7 @@ get '/starting_stat_pts/:stock' do
end end
get '/resources/:stock' do get '/resources/:stock' do
if DATA[:stocks].include? params['stock'] if DATA[:stock_objs].keys.include? params['stock']
json DATA[:resources][params['stock']] json DATA[:resources][params['stock']]
else else
404 404

@ -29,7 +29,6 @@ module Charred
end end
data.merge!({ data.merge!({
:stocks => stocks,
:skills => skills, :skills => skills,
:traits => traits, :traits => traits,
:lifepaths => lifepaths, :lifepaths => lifepaths,

@ -4,8 +4,6 @@ require_relative '../stock'
module Charred module Charred
module Troll module Troll
def load_troll(data) def load_troll(data)
data[:stocks] << 'troll'
file = File.read('data/troll/skills.json') file = File.read('data/troll/skills.json')
skills = JSON.parse(file) skills = JSON.parse(file)
verbose_merge data[:skills], skills verbose_merge data[:skills], skills

Loading…
Cancel
Save