method_missing is still considered scary, but here’s something more scary: forgetting to override respond_to?. Whoa, right? Just gave you an anxiety attack there. How about #method, though? Does that still work? Go ahead, try it. Here, I’ll try it with you: require 'ostruct' class Order def user @_user ||= OpenStruct.new(name: 'Mike', age: 28, occupation: 'slacker') end def method_missing(method_n
![Always Define respond_to_missing? When Overriding method_missing](https://cdn-ak-scissors.b.st-hatena.com/image/square/4aeea13effc70ae38e9c1837bf98436df85a9c6b/height=288;version=1;width=512/https%3A%2F%2Fimages.prismic.io%2Fthoughtbot-website%2FZn0Q2JbWFbowe7qY_default-article-background.png%3Fauto%3Dformat%252Ccompress%26mark-x%3D356%26mark-y%3D100%26mark64%3DaHR0cHM6Ly9hc3NldHMuaW1naXgubmV0L350ZXh0Lz90eHQtbGVhZD0wJnR4dC10cmFjaz0wJnR4dDY0PVFXeDNZWGx6SUVSbFptbHVaU0J5WlhOd2IyNWtYM1J2WDIxcGMzTnBibWNfSUZkb1pXNGdUM1psY25KcFpHbHVaeUJ0WlhSb2IyUmZiV2x6YzJsdVp3JTNEJTNEJnR4dGNscj1mNWY1ZjUmdHh0Zm9udD1JQk1QbGV4U2Fuc0pQLVNlbWlCb2xkJnR4dHBhZD0wJnR4dHNpemU9NjQmdz04MDA%253D%26txt-align%3Dcenter%252Cmiddle%26txt-color%3Df5f5f5%26txt-fit%3Dmax%26txt-font%3DIBMPlexSansJP-SemiBold%26txt-size%3D24%26txt-x%3D391%26txt-y%3D526%26txt%3DMike%2BBurns)