diff options
Diffstat (limited to 'lib/puppet/type.rb')
-rw-r--r-- | lib/puppet/type.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index 7aab88c9c..1e0bde5e7 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -35,7 +35,7 @@ class Type def self.states warnonce "The states method is deprecated; use properties" - properties() + properties end # All parameters, in the appropriate order. The key_attributes come first, then @@ -435,8 +435,8 @@ class Type # iterate across the existing properties def eachproperty - # properties() is a private method - properties().each { |property| + # properties is a private method + properties.each { |property| yield property } end @@ -706,7 +706,7 @@ class Type # is the first property, which is important for skipping 'retrieve' on # all the properties if the resource is absent. ensure_state = false - return properties().inject({}) do | prophash, property| + return properties.inject({}) do | prophash, property| if property.name == :ensure ensure_state = property.retrieve prophash[property] = ensure_state @@ -979,7 +979,7 @@ class Type def properties_to_audit(list) if list == :all - list = all_properties() if list == :all + list = all_properties if list == :all else list = Array(list).collect { |p| p.to_sym } end @@ -1329,7 +1329,7 @@ class Type # Find the default provider. def self.defaultprovider unless @defaultprovider - suitable = suitableprovider() + suitable = suitableprovider # Find which providers are a default for this system. defaults = suitable.find_all { |provider| provider.default? } @@ -1450,7 +1450,7 @@ class Type # We need to add documentation for each provider. def self.doc - @doc + " Available providers are:\n\n" + parenttype().providers.sort { |a,b| + @doc + " Available providers are:\n\n" + parenttype.providers.sort { |a,b| a.to_s <=> b.to_s }.collect { |i| "* **#{i}**: #{parenttype().provider(i).doc}" @@ -1684,7 +1684,7 @@ class Type # instance methods related to instance intrinsics - # e.g., initialize() and name() + # e.g., initialize and name public @@ -1880,7 +1880,7 @@ class Type end end -end # Puppet::Type +end end require 'puppet/provider' |