Class: NWN::Resources::DirectoryContainer

Inherits:
Container
  • Object
show all
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

#content

Instance Method Summary collapse

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