module Inventory
Public Class Methods
[](query)
click to toggle source
# File lib/Olib/character/inventory.rb, line 10 def Inventory.[](query) GameObj.inv.select { |item| item.name == query || item.id == query } end
containers()
click to toggle source
# File lib/Olib/character/inventory.rb, line 2 def Inventory.containers GameObj.containers end
items()
click to toggle source
# File lib/Olib/character/inventory.rb, line 16 def Inventory.items containers.map do |id, contents| contents.map(&:to_item) end.flatten end
to_s()
click to toggle source
# File lib/Olib/character/inventory.rb, line 6 def Inventory.to_s Inventory.items.map(&:to_s) end