summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-05-30 09:34:38 -0700
committerTim Smith <tsmith@chef.io>2018-05-30 09:34:38 -0700
commit27ea47db00e26beb6f77d4065f506b2b25e21391 (patch)
tree110e1ccea1bce873547eedc961d31e373a6cf149
parent8f4d0c5359ed21b6ebc8d844bfe72943b9db208c (diff)
downloadchef-readers.tar.gz
Use attr_reader in a few placesreaders
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/http.rb4
-rw-r--r--lib/chef/node.rb4
-rw-r--r--lib/chef/util/windows/net_use.rb6
3 files changed, 4 insertions, 10 deletions
diff --git a/lib/chef/http.rb b/lib/chef/http.rb
index 016e81d12c..3ba7fb8123 100644
--- a/lib/chef/http.rb
+++ b/lib/chef/http.rb
@@ -283,9 +283,7 @@ class Chef
# DEPRECATED: This is only kept around to provide access to cache control data in
# lib/chef/provider/remote_file/http.rb
# FIXME: Find a better API.
- def last_response
- @last_response
- end
+ attr_reader :last_response
private
diff --git a/lib/chef/node.rb b/lib/chef/node.rb
index f03e0ca0b1..979cf1296f 100644
--- a/lib/chef/node.rb
+++ b/lib/chef/node.rb
@@ -295,9 +295,7 @@ class Chef
Array(self[:roles]).include?(role_name)
end
- def primary_runlist
- @primary_runlist
- end
+ attr_reader :primary_runlist
attr_writer :override_runlist
def override_runlist(*args)
diff --git a/lib/chef/util/windows/net_use.rb b/lib/chef/util/windows/net_use.rb
index 196ce42215..39e11096ea 100644
--- a/lib/chef/util/windows/net_use.rb
+++ b/lib/chef/util/windows/net_use.rb
@@ -28,6 +28,8 @@ class Chef::Util::Windows::NetUse < Chef::Util::Windows
@use_name = localname
end
+ attr_reader :use_name
+
def to_ui2_struct(use_info)
use_info.inject({}) do |memo, (k, v)|
memo["ui2_#{k}".to_sym] = v
@@ -74,8 +76,4 @@ class Chef::Util::Windows::NetUse < Chef::Util::Windows
rescue Chef::Exceptions::Win32APIError => e
raise ArgumentError, e
end
-
- def use_name
- @use_name
- end
end