Created
September 11, 2018 17:59
-
-
Save buren/dfee29b3bfaa7eefd772c069e0e674ac to your computer and use it in GitHub Desktop.
Atom snippet - Ruby method missing template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'.source.ruby': | |
'def method_missing .. end': | |
'prefix': 'defmm' | |
'body': | |
''' | |
def method_missing(method_name, *arguments, &block) | |
if ${1}.respond_to?(method_name) | |
${1}.public_send(method_name, *arguments, &block) | |
else | |
super | |
end | |
end | |
def respond_to_missing?(method_name, include_private = false) | |
${1}.respond_to?(method_name) || super | |
end | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment