Skip to content

Instantly share code, notes, and snippets.

@tatat
Created June 17, 2013 12:59
Show Gist options
  • Save tatat/5796683 to your computer and use it in GitHub Desktop.
Save tatat/5796683 to your computer and use it in GitHub Desktop.
module M1
def nyan1
run_callback(->(*args){ args.join }, '1', '2', '3')
end
private
def run_callback(callback, *args)
callback.(*args)
end
end
module M2
def nyan2
run_callback
end
private
def run_callback
end
end
class A
include M1
include M2
end
p A.new.nyan2 #=> nil
p A.new.nyan1 #=> `run_callback': wrong number of arguments (4 for 0) (ArgumentError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment