Skip to content

Instantly share code, notes, and snippets.

@buren buren/snippets.cson
Created Sep 11, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.