summaryrefslogtreecommitdiff
path: root/chef/lib/chef/node
diff options
context:
space:
mode:
authorDaniel DeLeo <dan@opscode.com>2010-07-15 11:59:58 -0700
committerDaniel DeLeo <dan@opscode.com>2010-07-15 11:59:58 -0700
commit65f1976fda430dc6c6eaa34cf7102a405b8dbd48 (patch)
treea07b4c48a67619f0c323dd724cdc5695b0ee0788 /chef/lib/chef/node
parent72f3367ee8c35e220b1a32a87aa17d8b91048847 (diff)
downloadchef-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.rb5
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