Created
January 19, 2016 12:21
-
-
Save osyo-manga/2e22d7b3d41f6d3a04df to your computer and use it in GitHub Desktop.
test.rb
This file contains hidden or 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
| require "stitcher" | |
| using Stitcher | |
| class Super | |
| stitcher_require [Fixnum] | |
| def func a | |
| p "Fixnum" | |
| end | |
| end | |
| class X < Super | |
| stitcher_require [Numeric] | |
| def func a | |
| p "Numeric" | |
| end | |
| stitcher_require [Object] | |
| def func a | |
| p "Object" | |
| end | |
| stitcher_require [String] | |
| def func a | |
| p "String" | |
| end | |
| end | |
| x = X.new | |
| x.func 10 | |
| x.func 10.0 | |
| x.func "10" | |
| x.func [] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment