diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-16 23:59:08 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-16 23:59:08 +0000 |
| commit | 9fa779469071438f2160e45e8ab75d74e220f63b (patch) | |
| tree | f173ea2b2954a6d46291c75f4f267df25f7973e8 /lib | |
| parent | 0dbe96d26b7f592a4c9ec7055b66e0dc14701a9b (diff) | |
| download | puppet-9fa779469071438f2160e45e8ab75d74e220f63b.tar.gz puppet-9fa779469071438f2160e45e8ab75d74e220f63b.tar.xz puppet-9fa779469071438f2160e45e8ab75d74e220f63b.zip | |
Simplifying the the Puppet::Type[] method
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1942 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/puppet/metatype/instances.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/puppet/metatype/instances.rb b/lib/puppet/metatype/instances.rb index a26c30686..351f4c580 100644 --- a/lib/puppet/metatype/instances.rb +++ b/lib/puppet/metatype/instances.rb @@ -6,13 +6,7 @@ class Puppet::Type # retrieve a named instance of the current type def self.[](name) - if @objects.has_key?(name) - return @objects[name] - elsif @aliases.has_key?(name) - return @aliases[name] - else - return nil - end + @objects[name] || @aliases[name] end # add an instance by name to the class list of instances |
