summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-04-22 10:57:01 -0700
committerdanielsdeleo <dan@opscode.com>2013-04-22 10:57:01 -0700
commit673bcd70e5beee892c2f45ae1d19e2205a7c7c13 (patch)
tree8511513bd6ed9dcf2322105a22b20bd15a4c4375
parent2cc7d616caccc2fd0cb0e0b851e05ba33b95af80 (diff)
downloadchef-673bcd70e5beee892c2f45ae1d19e2205a7c7c13.tar.gz
[CHEF-3432] explain class var usage for resource_classes
-rw-r--r--lib/chef/resource.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 5b3a3f49b3..bf5e43443e 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -132,6 +132,9 @@ F
# Track all subclasses of Resource. This is used so names can be looked up
# when attempting to deserialize from JSON. (See: json_compat)
def self.resource_classes
+ # Using a class variable here ensures we have one variable to track
+ # subclasses shared by the entire class hierarchy; without this, each
+ # subclass would have its own list of subclasses.
@@resource_classes ||= []
end