Class: Contrek::Cpp::CPPTempfile
- Inherits:
-
CPPOfstream
- Object
- CPPOfstream
- Contrek::Cpp::CPPTempfile
- Defined in:
- lib/contrek/cpp/cpp_tempfile.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.new(name) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/contrek/cpp/cpp_tempfile.rb', line 6 def self.new(name) require "tempfile" tempfile = Tempfile.new(name) instance = super(tempfile.path) instance.instance_variable_set(:@tempfile, tempfile) instance end |
Instance Method Details
#close ⇒ Object
18 19 20 21 |
# File 'lib/contrek/cpp/cpp_tempfile.rb', line 18 def close super @tempfile.close end |
#path ⇒ Object
14 15 16 |
# File 'lib/contrek/cpp/cpp_tempfile.rb', line 14 def path @tempfile.path end |
#unlink ⇒ Object
23 24 25 |
# File 'lib/contrek/cpp/cpp_tempfile.rb', line 23 def unlink @tempfile.unlink end |