Skip to content

Instantly share code, notes, and snippets.

@yuroyoro
Created November 24, 2015 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuroyoro/ecadf3cecedbd5297b04 to your computer and use it in GitHub Desktop.
Save yuroyoro/ecadf3cecedbd5297b04 to your computer and use it in GitHub Desktop.
class NilClass
def method_missing(method, *args)
case self.class
when Foo
# do something about foo is nil
when Bar
# do something about bar is nil
# ...
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment