Fork of https://github.com/modality/charred-black. Short term, has some fixes. Long term, may include a tool to create and edit stock/lifepath/skill/trait data. http://charred.obscuritus.ca:8080/#/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
charred-gold/src/lib/stock.rb

35 lines
735 B

module Charred
class Stock
2 years ago
@@default_stride = 7
attr :key
attr :name
attr :stride
attr :common_traits
attr :starting_stats
2 years ago
def initialize(h)
@key = h["key"]
@name = h["name"] || @key
2 years ago
@stride = h["stride"] || @@default_stride
@adjective = h["adjective"] || @key+"ish"
2 years ago
@common_traits = h["common_traits"]
@starting_stats = h["starting_stats"]
end
2 years ago
def as_json(options = {})
{
"key" => @key,
"name" => @name,
"stride" => @stride,
"adjective" => @adjective,
"common_traits" => @common_traits,
"starting_stats" => @starting_stats
}
end
def to_json(*a)
as_json.to_json(*a)
end
end
end