Module: NWN::TwoDA::Cache
- Defined in:
- lib/nwn/helpers.rb
Overview
This is a simple 2da cache.
Class Method Summary collapse
-
.get(name) ⇒ Object
Get the 2da file with the given name.
-
.setup(root) ⇒ Object
Set the file system path where all 2da files reside.
Class Method Details
.get(name) ⇒ Object
Get the 2da file with the given name. name
is without extension.
21 22 23 24 |
# File 'lib/nwn/helpers.rb', line 21 def self.get(name) raise Exception, "You need to set up the cache first through Cache.setup." unless @_root @_cache[name.downcase] ||= read_2da(name.downcase) end |