3 ms·
Thanks for linking this. I'd only glanced at refinements so far... reading these comments and example code makes my head hurt. I wouldn't have thought "solving"
by themgt 14y ago
Thanks for linking this. I'd only glanced at refinements so far... reading these comments and example code makes my head hurt. I wouldn't have thought "solving" monkey-patching with something even more convoluted and confusing was even possible. My favorite code example is from tenderlove:
class Foo < SomeParent
def baz(str)
cached = str.camelize
ary.map {|name| cached + name}
end
end
Could have a completely different meaning than this code:
class Foo < SomeParent
def baz(str)
ary.map {|name| str.camelize + name}
end
end
/lights hair on fire