Skip to content

Instantly share code, notes, and snippets.

@kenchan kenchan/hoge.rb
Last active Mar 7, 2018

Embed
What would you like to do?
[1] pry(main)> module X
[1] pry(main)* def m
[1] pry(main)* puts 'X1'
[1] pry(main)* super
[1] pry(main)* puts 'X2'
[1] pry(main)* end
[1] pry(main)* end
=> :m
[2] pry(main)> class A
[2] pry(main)* def self.m
[2] pry(main)* puts 'A'
[2] pry(main)* end
[2] pry(main)* end
=> :m
[3] pry(main)> A.singleton_class.prepend X
=> #<Class:A>
[4] pry(main)> A.m
X1
A
X2
=> nil
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.