Class: VmxFile
- Includes:
- Dslify
- Defined in:
- lib/poolparty/net/remoter_bases/vmrun/utilities/vmx_file.rb
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(o = {}) ⇒ VmxFile
constructor
A new instance of VmxFile.
- #set(k, v) ⇒ Object
- #to_vmx ⇒ Object
Constructor Details
#initialize(o = {}) ⇒ VmxFile
Returns a new instance of VmxFile.
99 100 101 |
# File 'lib/poolparty/net/remoter_bases/vmrun/utilities/vmx_file.rb', line 99 def initialize(o={}) ({:vmx_file => }.merge(o)) end |
Instance Method Details
#compile ⇒ Object
107 108 109 |
# File 'lib/poolparty/net/remoter_bases/vmrun/utilities/vmx_file.rb', line 107 def compile ::File.open("#{base_directory}/#{name}/#{name}.vmx", "w") {|f| f << to_vmx } end |
#set(k, v) ⇒ Object
103 104 105 |
# File 'lib/poolparty/net/remoter_bases/vmrun/utilities/vmx_file.rb', line 103 def set(k,v) [:vmx_file]["#{k}"] = v end |
#to_vmx ⇒ Object
110 111 112 113 114 115 116 |
# File 'lib/poolparty/net/remoter_bases/vmrun/utilities/vmx_file.rb', line 110 def to_vmx out = [] [:vmx_file].each do |k,v| out << "#{k}=\"#{v}\"" end out.join("\n") end |