class Scroll

Attributes

spells[RW]
whitelist[RW]
worthy[RW]

Public Class Methods

add_to_whitelist(*args) click to toggle source
# File lib/Olib/objects/scroll.rb, line 22
def Scroll.add_to_whitelist(*args)
  @@whitelist + args
end
new(item) click to toggle source
Calls superclass method Olib::Item::new
# File lib/Olib/objects/scroll.rb, line 30
def initialize(item)
  super item
  @spells = []
  return self
end
remove_from_whitelist(*args) click to toggle source
# File lib/Olib/objects/scroll.rb, line 26
def Scroll.remove_from_whitelist(*args)
  @@whitelist = @@whitelist - args
end
whitelist() click to toggle source
# File lib/Olib/objects/scroll.rb, line 18
def Scroll.whitelist
  @@whitelist
end

Public Instance Methods

worthy?() click to toggle source
# File lib/Olib/objects/scroll.rb, line 36
def worthy?
  @worthy = false
  read unless @spells.length > 0
  @spells.each do |spell| @worthy = true if Scroll.whitelist.include? spell[:n] end
  @worthy
end