About
Hi! I'm Avdi Grimm, and this is my software development blog. More...
Books and Screencasts
Objects on Rails
A developer notebook on applying classic Object-Oriented principles to Ruby on Rails projects.
-
Subscribe
-
Recent Posts
Archives
Categories
Meta
Category Archives: Stupid Ruby Tricks
Defining #method_missing and #respond_to? at the same time
I was reading Eloquent Ruby yesterday morning (buy a copy if you haven’t already), and it got me thinking about one of my “favorite” Ruby gotchas: defining #method_missing without a corresponding #respond_to?. E.g.: class Liar def method_missing(*args) “Oops, I lied” … Continue reading →
Posted in Stupid Ruby Tricks
|
Tagged metaprogramming, method_missing, respond_to, ruby
|
24 Comments




