summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Walters <cw@opscode.com>2011-03-25 15:20:42 -0700
committerChris Walters <cw@opscode.com>2011-03-25 15:31:06 -0700
commitd6ec97d39cd0661f0233eacec89e6bba076bcad0 (patch)
tree0f35bafbce801883717164a380cc81319b088ffc
parent9ea61b71979813abebdf34421599833058d5324f (diff)
downloadchef-d6ec97d39cd0661f0233eacec89e6bba076bcad0.tar.gz
Implementing Chef::Cookbook::Metadata#to_hash
-rw-r--r--chef/lib/chef/cookbook/metadata.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/chef/lib/chef/cookbook/metadata.rb b/chef/lib/chef/cookbook/metadata.rb
index b73362fe0a..a41acd1b50 100644
--- a/chef/lib/chef/cookbook/metadata.rb
+++ b/chef/lib/chef/cookbook/metadata.rb
@@ -386,8 +386,8 @@ class Chef
@groupings[name]
end
- def to_json(*a)
- result = {
+ def to_hash
+ {
:name => self.name,
:description => self.description,
:long_description => self.long_description,
@@ -406,7 +406,10 @@ class Chef
:recipes => self.recipes,
:version => self.version
}
- result.to_json(*a)
+ end
+
+ def to_json(*a)
+ self.to_hash.to_json(*a)
end
def self.from_hash(o)