summaryrefslogtreecommitdiff
path: root/lib/chef/resource.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r--lib/chef/resource.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 1440b2eb61..5222dc7286 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -682,7 +682,7 @@ class Chef
Chef::JSONCompat.to_json(results, *a)
end
- def to_hash
+ def to_h
# Grab all current state, then any other ivars (backcompat)
result = {}
self.class.state_properties.each do |p|
@@ -697,6 +697,8 @@ class Chef
result
end
+ alias_method :to_hash, :to_h
+
def self.from_hash(o)
resource = new(o["instance_vars"]["@name"])
o["instance_vars"].each do |k, v|