Also Thanks!
Will Mernagh, Eric Kidd, Dan McClain, William Josephson,
Brian Cardarella, Wyatt Greene, Mark Bates, Scott
Schulthess, Matte Noble, Kareem Kouddous, Barun Singh,
and Ben Orenstein.
Slide 7
Slide 7 text
Upcoming Events
12.4: Project Night
12.11: Main Meeting
2.??: Rails Bridge Boston
module ActiveSupport
refine String do
def camelize(first_letter = :upper)
case 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/
module FooBar
def hello
puts 2
super
end
end
class 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