Skip to content

Instantly share code, notes, and snippets.

@buren
Created September 11, 2018 17:59
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 buren/dfee29b3bfaa7eefd772c069e0e674ac to your computer and use it in GitHub Desktop.
Save buren/dfee29b3bfaa7eefd772c069e0e674ac to your computer and use it in GitHub Desktop.
Atom snippet - Ruby method missing template
'.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