So google for a solution to this problem and found myself here:
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/eaa34998a74831b4/58b80fe0d4eadb1a?lnk=gst&q=+how+to+monkeypatch+Hash%27s+%5B%5D%3D+method+#58b80fe0d4eadb1a
But while reading, and admittedly not quite getting the
I'm trying to monkeypatch the []= method in the Hash class:
Hash.class_eval do
def []_with_feature=(a,b)
puts 'foo'
end
alias_method_chain :[]=, :feature
end
Something is wrong with the syntax, but I can't figure out what. The
alias_method_chain method does look for punctuation (= in t
2 matches
Mail list logo