Class: Yast::BootloaderRoutinesLibIfaceInclude::TmpYAMLFile
- Inherits:
-
Object
- Object
- Yast::BootloaderRoutinesLibIfaceInclude::TmpYAMLFile
- Defined in:
- src/include/bootloader/routines/lib_iface.rb
Instance Attribute Summary (collapse)
-
- (Object) path
readonly
Returns the value of attribute path.
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Object) data
-
- (TmpYAMLFile) initialize(data = nil)
constructor
A new instance of TmpYAMLFile.
- - (Object) unlink
Constructor Details
- (TmpYAMLFile) initialize(data = nil)
Returns a new instance of TmpYAMLFile
50 51 52 53 |
# File 'src/include/bootloader/routines/lib_iface.rb', line 50 def initialize(data = nil) @path = mktemp write_data(data) unless data.nil? end |
Instance Attribute Details
- (Object) path (readonly)
Returns the value of attribute path
41 42 43 |
# File 'src/include/bootloader/routines/lib_iface.rb', line 41 def path @path end |
Class Method Details
+ (Object) open(data = nil, &block)
43 44 45 46 47 48 |
# File 'src/include/bootloader/routines/lib_iface.rb', line 43 def self.open(data = nil, &block) file = new(data) block.call(file) ensure file.unlink if file end |
Instance Method Details
- (Object) data
59 60 61 |
# File 'src/include/bootloader/routines/lib_iface.rb', line 59 def data YAML.load(SCR.Read(Path.new(".target.string"), path)) end |
- (Object) unlink
55 56 57 |
# File 'src/include/bootloader/routines/lib_iface.rb', line 55 def unlink SCR.Execute(Path.new(".target.remove"), path) end |