summaryrefslogtreecommitdiff
path: root/lib/custodian/testfactory.rb
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
commit68e4dba17a51d073ac84f46199edc11aeccf2c71 (patch)
treef967412b5837e42ab4669015462e1fd7efda7451 /lib/custodian/testfactory.rb
parenta6853706178388422e725f07f2bb0445fdeb7bd6 (diff)
Added test_type() to return the name this class was registered with.
Diffstat (limited to 'lib/custodian/testfactory.rb')
-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
#