Class: Bbq::Util
- Inherits:
-
Object
- Object
- Bbq::Util
- Defined in:
- lib/bbq/util.rb
Class Method Summary collapse
Class Method Details
.find_module(name, scope = nil) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/bbq/util.rb', line 5 def self.find_module(name, scope = nil) namespace = case scope when String, Symbol "::#{scope.to_s.camelize}" when Class "::#{scope.name}" when NilClass nil else "::#{scope.class.name}" end "#{namespace}::#{name.to_s.camelize}".constantize end |