diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-24 14:59:16 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-24 14:59:16 +0000 |
commit | 5608b3f3d02b49f51cd8ce233ecfa41dad9bfa4e (patch) | |
tree | f967412b5837e42ab4669015462e1fd7efda7451 | |
parent | 4ac494fc860dc1c9d50a0d3e68679cb4fb9534b6 (diff) |
Added test_type() to return the name this class was registered with.
-rw-r--r-- | lib/custodian/testfactory.rb | 11 |
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 # |