lib/sugar-high/module.rb in sugar-high-0.1.5 vs lib/sugar-high/module.rb in sugar-high-0.1.6
- old
+ new
@@ -1,6 +1,14 @@
require 'active_support/inflector'
+class Module
+ def last_name
+ # name.gsub /^(.*)::/, ''
+ name.demodulize
+ end
+ alias_method :demodulize, :last_name
+end
+
def modules *module_names, &block
module_names.flatten.each do |name|
class_eval %{
module #{name.to_s.camelize}
#{yield block if block}