summaryrefslogtreecommitdiff
path: root/lib/custodian
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-24 14:59:16 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-24 14:59:16 +0000
commit5608b3f3d02b49f51cd8ce233ecfa41dad9bfa4e (patch)
treef967412b5837e42ab4669015462e1fd7efda7451 /lib/custodian
parent4ac494fc860dc1c9d50a0d3e68679cb4fb9534b6 (diff)
Added test_type() to return the name this class was registered with.
Diffstat (limited to 'lib/custodian')
-rw-r--r--lib/custodian/testfactory.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/custodian/testfactory.rb b/lib/custodian/testfactory.rb
index 179b050..f5e342d 100644
--- a/lib/custodian/testfactory.rb
+++ b/lib/custodian/testfactory.rb
@@ -68,6 +68,17 @@ module Custodian
end
+ #
+ # Get the friendly-type of this class
+ #
+ def get_type
+ @@subclasses.each do |name,value|
+ if ( value == self.class )
+ return name
+ end
+ end
+ nil
+ end
#