summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-10-28 19:40:32 -0500
committerLuke Kanies <luke@madstop.com>2008-11-04 16:20:45 -0600
commit77d73e0230e466182c13a600a6c5cf8de67654e7 (patch)
tree9cf9cac701960daef302791a7174ebccebcfff55 /lib/puppet
parent05e1325891b2ab22088dcd34dd54e4afcbf59ddb (diff)
downloadpuppet-77d73e0230e466182c13a600a6c5cf8de67654e7.tar.gz
puppet-77d73e0230e466182c13a600a6c5cf8de67654e7.tar.xz
puppet-77d73e0230e466182c13a600a6c5cf8de67654e7.zip
Changing the meaning of the unused Puppet::Type#parameter method to return an instance
rather than a value. This parallels and largely obviates the 'property' method. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/type.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index 85f72f79a..da274df88 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -601,10 +601,7 @@ class Type
# return the value of a parameter
def parameter(name)
- unless name.is_a? Symbol
- name = name.intern
- end
- return @parameters[name].value
+ @parameters[name.to_sym]
end
# Is the named property defined?
@@ -615,8 +612,9 @@ class Type
return @parameters.include?(name)
end
- # return an actual type by name; to return the value, use 'inst[name]'
- # FIXME this method should go away
+ # Return an actual property instance by name; to return the value, use 'resource[param]'
+ # LAK:NOTE(20081028) Since the 'parameter' method is now a superset of this method,
+ # this one should probably go away at some point.
def property(name)
if obj = @parameters[symbolize(name)] and obj.is_a?(Puppet::Property)
return obj