class Natural20::Spell

Attributes

errors[RW]
properties[R]
source[R]

Public Class Methods

apply!(battle, item) click to toggle source
# File lib/natural_20/spell_library/spell.rb, line 20
def self.apply!(battle, item); end
new(source, spell_name, details) click to toggle source
# File lib/natural_20/spell_library/spell.rb, line 5
def initialize(source, spell_name, details)
  @name = spell_name
  @properties = details
  @source = source
  @errors = []
end

Public Instance Methods

id() click to toggle source
# File lib/natural_20/spell_library/spell.rb, line 16
def id
  @properties[:id]
end
label() click to toggle source
# File lib/natural_20/spell_library/spell.rb, line 12
def label
  t(:"spell.#{@name}")
end
validate!(_action) click to toggle source
# File lib/natural_20/spell_library/spell.rb, line 22
def validate!(_action)
  @errors.clear
end

Protected Instance Methods

t(token, options = {}) click to toggle source
# File lib/natural_20/spell_library/spell.rb, line 28
def t(token, options = {})
  I18n.t(token, **options)
end