diff options
author | Daniel DeLeo <dan@opscode.com> | 2010-07-15 11:59:58 -0700 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2010-07-15 11:59:58 -0700 |
commit | 65f1976fda430dc6c6eaa34cf7102a405b8dbd48 (patch) | |
tree | a07b4c48a67619f0c323dd724cdc5695b0ee0788 /chef/lib/chef/node | |
parent | 72f3367ee8c35e220b1a32a87aa17d8b91048847 (diff) | |
download | chef-65f1976fda430dc6c6eaa34cf7102a405b8dbd48.tar.gz |
[CHEF-1329] instance variables are given as symbols on ruby 1.9
Diffstat (limited to 'chef/lib/chef/node')
-rw-r--r-- | chef/lib/chef/node/attribute.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chef/lib/chef/node/attribute.rb b/chef/lib/chef/node/attribute.rb index 2275521053..e7f99d09d4 100644 --- a/chef/lib/chef/node/attribute.rb +++ b/chef/lib/chef/node/attribute.rb @@ -23,6 +23,8 @@ require 'chef/log' class Chef class Node class Attribute + HIDDEN_ATTRIBUES = [:@override, :@attribute, :@default, :@normal, :@automatic] + attr_accessor :normal, :default, :override, @@ -428,10 +430,9 @@ class Chef def inspect determine_value(current_automatic, current_override, current_normal, current_default) - exclude_attrs = ["@override", "@attribute", "@default", "@normal", "@automatic"] "#<#{self.class} " << instance_variables.map{|iv| - iv + '=' + (exclude_attrs.include?(iv) ? "{...}" : instance_variable_get(iv).inspect) + iv.to_s + '=' + (HIDDEN_ATTRIBUES.include?(iv.to_sym) ? "{...}" : instance_variable_get(iv).inspect) }.join(', ') << ">" end |