class FifthedSim::StatBlock

Public Class Methods

define(&block) click to toggle source
# File lib/fifthed_sim/stat_block.rb, line 36
def self.define(&block)
  h = DefinitionProxy.new(&block)
  self.new(h.hash)
end
new(hash) click to toggle source
# File lib/fifthed_sim/stat_block.rb, line 41
def initialize(hash)
  @hash = Hash[hash.map do |k, v|
    if v.is_a?(Stat)
      [k, v]
    else
      [k, Stat.new(v)]
    end
  end]
end