Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/action_profiler/path2class.rb
Instance Method Summary collapse
-
#path2class(klassname) ⇒ Object
Retrieves the class or module for the path
klassname(such as “Test::Unit::TestCase”).
Instance Method Details
#path2class(klassname) ⇒ Object
Retrieves the class or module for the path klassname (such as “Test::Unit::TestCase”).
7 8 9 |
# File 'lib/action_profiler/path2class.rb', line 7 def path2class(klassname) klassname.split('::').inject(Object) { |k,n| k.const_get n } end |