Class: Factory
- Inherits:
-
Object
- Object
- Factory
- Defined in:
- lib/factory_girl_namespacing_fix.rb
Instance Method Summary collapse
Instance Method Details
#class_for(class_or_to_s) ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/factory_girl_namespacing_fix.rb', line 2 def class_for (class_or_to_s) if class_or_to_s.respond_to?(:to_sym) variable_name_to_class_name(class_or_to_s).split('::').inject(Object) { |o, str| o.const_get(str) } else class_or_to_s end end |