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.
114 115 116 117 118 119 120 |
# File 'lib/nwn/res.rb', line 114 def initialize path super() @path = path Dir[path + "/*.*"].each {|x| add_file x } end |