parent
ce4c372290
commit
dd5cf6dcdc
@ -1,22 +1,34 @@ |
||||
module Charred |
||||
# module Stock |
||||
class Stock |
||||
@@default_stride = 6 |
||||
|
||||
attr :key |
||||
attr :name |
||||
attr :stride |
||||
attr :common_traits |
||||
attr :settings |
||||
attr :starting_stats |
||||
|
||||
def initialize(key, name) |
||||
def initialize(key, name = key, stride = @@default_stride) |
||||
@key = key |
||||
@name = name |
||||
@stride = stride |
||||
@common_traits = [] |
||||
@settings = [] |
||||
@starting_stats = [] |
||||
end |
||||
def as_json(options = {}) |
||||
{ |
||||
"key" => key, |
||||
"name" => name |
||||
"name" => name, |
||||
"stride" => stride, |
||||
"common_traits" => common_traits, |
||||
"settings" => settings, |
||||
"starting_stats" => starting_stats |
||||
} |
||||
end |
||||
def to_json(*a) |
||||
as_json.to_json(*a) |
||||
end |
||||
# end |
||||
end |
||||
end |
||||
|
Loading…
Reference in new issue