From e5676ab347399a1f32e77bf4f64eaa73d54a895b Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 14 Apr 2005 04:18:25 +0000 Subject: testing keyword git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@148 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/blink/objects.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/blink/objects.rb b/lib/blink/objects.rb index e00b7ac7c..14ecd92b5 100644 --- a/lib/blink/objects.rb +++ b/lib/blink/objects.rb @@ -5,12 +5,17 @@ require 'blink/attribute' require 'blink/interface' +puts Blink.class module Blink class Objects < Blink::Interface include Enumerable - @objects = Hash.new # a class instance variable - @@allobjects = Array.new # and then a hash for all objects + @objects = Hash.new + @@allobjects = Array.new # and then an array for all objects + + @@types = Hash.new { |hash,key| + raise "Object type %s not found" % key + } #--------------------------------------------------------------- # the class methods @@ -31,6 +36,13 @@ module Blink @objects = Hash.new @actions = Hash.new } + + if @@types.include?(sub.name) + Blink.notice("Redefining object type %s" % sub.name) + else + #Blink.debug("Defining object type %s" % sub.name) + end + @@types[sub.name] = sub end #----------------------------------- -- cgit