summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-08-26 15:09:22 -0700
committerKartik Null Cating-Subramanian <ksubramanian@chef.io>2015-08-27 11:54:58 -0400
commit096f4511f8418b6544ab02f30c0c23eba67bd964 (patch)
treed824de09b050027c230d2da31bf523d69612bd61
parent915f85116eef6d72ab516163cbd00e7a97073090 (diff)
downloadchef-096f4511f8418b6544ab02f30c0c23eba67bd964.tar.gz
Stop using @instance_variable
-rw-r--r--lib/chef/util/windows/volume.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/chef/util/windows/volume.rb b/lib/chef/util/windows/volume.rb
index 0d26d5937e..6e45594ba6 100644
--- a/lib/chef/util/windows/volume.rb
+++ b/lib/chef/util/windows/volume.rb
@@ -22,16 +22,16 @@ require 'chef/win32/api/file'
require 'chef/util/windows'
class Chef::Util::Windows::Volume < Chef::Util::Windows
- public
+ attr_reader :mount_point
def initialize(name)
name += "\\" unless name =~ /\\$/ #trailing slash required
- @name = name
+ @mount_point = name
end
def device
begin
- Chef::ReservedNames::Win32::File.get_volume_name_for_volume_mount_point(@name)
+ Chef::ReservedNames::Win32::File.get_volume_name_for_volume_mount_point(mount_point)
rescue Chef::Exceptions::Win32APIError => e
raise ArgumentError, e
end
@@ -39,7 +39,7 @@ class Chef::Util::Windows::Volume < Chef::Util::Windows
def delete
begin
- Chef::ReservedNames::Win32::File.delete_volume_mount_point(@name)
+ Chef::ReservedNames::Win32::File.delete_volume_mount_point(mount_point)
rescue Chef::Exceptions::Win32APIError => e
raise ArgumentError, e
end
@@ -47,9 +47,13 @@ class Chef::Util::Windows::Volume < Chef::Util::Windows
def add(args)
begin
- Chef::ReservedNames::Win32::File.set_volume_mount_point(@name, args[:remote])
+ Chef::ReservedNames::Win32::File.set_volume_mount_point(mount_point, args[:remote])
rescue Chef::Exceptions::Win32APIError => e
raise ArgumentError, e
end
end
+
+ def mount_point
+ @mount_point
+ end
end