Class: NWN::Resources::DirectoryContainer
- Defined in:
- lib/nwn/res.rb
Overview
A Container that directly wraps a directory (e.g. override/). Does not update on changes - caches the directory entries on initialize.
Instance Attribute Summary
Attributes inherited from Container
Instance Method Summary collapse
-
#initialize(path) ⇒ DirectoryContainer
constructor
A new instance of DirectoryContainer.
Methods inherited from Container
#add, #add_file, #filenames, #get, #get_content_object, #has?
Constructor Details
#initialize(path) ⇒ DirectoryContainer
Returns a new instance of DirectoryContainer.
115 116 117 118 119 120 121 122 123 124 |
# File 'lib/nwn/res.rb', line 115 def initialize path super() @path = path Dir[path + File::SEPARATOR + "*.*"].each {|x| begin add_file x rescue ArgumentError => e NWN.log_debug e.to_s end } end |