summaryrefslogtreecommitdiff
path: root/chef/lib/chef/node
diff options
context:
space:
mode:
authorAJ Christensen <aj@opscode.com>2009-08-11 13:59:50 +1200
committerAJ Christensen <aj@opscode.com>2009-08-11 13:59:50 +1200
commit7275e9d539eb397248071e99d975d66cf66b4585 (patch)
tree65f26413d443e97a4a7c84a84ab681b4ac58c858 /chef/lib/chef/node
parent37382535487aef0d06b015ceb465178ad74bb688 (diff)
downloadchef-7275e9d539eb397248071e99d975d66cf66b4585.tar.gz
CHEF-483: Hashey hashness: add #size #length
Diffstat (limited to 'chef/lib/chef/node')
-rw-r--r--chef/lib/chef/node/attribute.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/chef/lib/chef/node/attribute.rb b/chef/lib/chef/node/attribute.rb
index 6e01a6961c..a0c21aed5e 100644
--- a/chef/lib/chef/node/attribute.rb
+++ b/chef/lib/chef/node/attribute.rb
@@ -175,6 +175,12 @@ class Chef::Node
self.collect { |h| h[1] }
end
+ def size
+ self.collect{}.length
+ end
+
+ alias :length :size
+
def get_keys
keys
end