first_letter when :upper then ActiveSupport::Inflector.camelize(self, true) when :lower then ActiveSupport::Inflector.camelize(self, false) end end end end module ActionDispatch module Routing class RouteSet using ActiveSupport def controller_reference(controller_param) unless controller = @controllers[controller_param] controller_name = "#{controller_param.camelize}Controller" controller = @controllers[controller_param] = ActiveSupport::Dependencies.ref(controller_name) end controller.get end end end end http://yehudakatz.com/2010/11/30/ruby-2-0-refinements-in-practice/
Foo def hello puts 'hello' end end class Bar < Foo prepend FooBar def hello puts 1 super end end Bar.new.hello 2 1 "hello" http://dev.af83.com/2012/10/19/ruby-2-0-module-prepend.html