Class: Chef::Util::Windows::Volume
- Inherits:
-
Chef::Util::Windows
- Object
- Chef::Util::Windows
- Chef::Util::Windows::Volume
- Defined in:
- lib/chef/util/windows/volume.rb
Instance Attribute Summary collapse
-
#mount_point ⇒ Object
readonly
Returns the value of attribute mount_point.
Instance Method Summary collapse
- #add(args) ⇒ Object
- #delete ⇒ Object
- #device ⇒ Object
-
#initialize(name) ⇒ Volume
constructor
A new instance of Volume.
Constructor Details
#initialize(name) ⇒ Volume
Returns a new instance of Volume.
27 28 29 30 |
# File 'lib/chef/util/windows/volume.rb', line 27 def initialize(name) name += "\\" unless /\\$/.match?(name) # trailing slash required @mount_point = name end |
Instance Attribute Details
#mount_point ⇒ Object (readonly)
Returns the value of attribute mount_point.
25 26 27 |
# File 'lib/chef/util/windows/volume.rb', line 25 def mount_point @mount_point end |
Instance Method Details
#add(args) ⇒ Object
44 45 46 47 48 |
# File 'lib/chef/util/windows/volume.rb', line 44 def add(args) Chef::ReservedNames::Win32::File.set_volume_mount_point(mount_point, args[:remote]) rescue Chef::Exceptions::Win32APIError => e raise ArgumentError, e end |
#delete ⇒ Object
38 39 40 41 42 |
# File 'lib/chef/util/windows/volume.rb', line 38 def delete Chef::ReservedNames::Win32::File.delete_volume_mount_point(mount_point) rescue Chef::Exceptions::Win32APIError => e raise ArgumentError, e end |
#device ⇒ Object
32 33 34 35 36 |
# File 'lib/chef/util/windows/volume.rb', line 32 def device Chef::ReservedNames::Win32::File.get_volume_name_for_volume_mount_point(mount_point) rescue Chef::Exceptions::Win32APIError => e raise ArgumentError, e end |