-
-
Save gr33n7007h/dd940a9a6fc99124704c64360035d4c1 to your computer and use it in GitHub Desktop.
w
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
>> | |
>> class X def foo() str.upcase end end | |
=> :foo | |
>> | |
>> Bar = Struct.new(:str) do | |
| define_method(:foo, X.instance_method(:foo)) | |
| end | |
TypeError: bind argument must be a subclass of X | |
from (pry):3:in `define_method' | |
>> | |
>> Pointer[dlwrap X][0,8] = Pointer[dlwrap Module.new][0,8] | |
=> "C\x00\x00\x00\x00\x00\x00\x00" | |
>> | |
>> Bar = Struct.new(:str) do | |
| define_method(:foo, X.instance_method(:foo)) | |
| end | |
=> Bar | |
>> | |
>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment