Class: MongoTestServer::TmpStorage
- Inherits:
-
Object
- Object
- MongoTestServer::TmpStorage
- Defined in:
- lib/mongo_test_server/tmp_storage.rb
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
-
#initialize(name) ⇒ TmpStorage
constructor
A new instance of TmpStorage.
- #path ⇒ Object
Constructor Details
#initialize(name) ⇒ TmpStorage
Returns a new instance of TmpStorage.
10 11 12 13 |
# File 'lib/mongo_test_server/tmp_storage.rb', line 10 def initialize(name) @name = "#{name}-mongo-tmp" @tmp_dir = "#{Dir.tmpdir}/#{@name}" end |
Instance Method Details
#create ⇒ Object
15 16 17 18 |
# File 'lib/mongo_test_server/tmp_storage.rb', line 15 def create FileUtils.mkdir_p @tmp_dir path end |
#delete ⇒ Object
24 25 26 |
# File 'lib/mongo_test_server/tmp_storage.rb', line 24 def delete FileUtils.rm_rf @tmp_dir end |
#path ⇒ Object
20 21 22 |
# File 'lib/mongo_test_server/tmp_storage.rb', line 20 def path @tmp_dir end |