Created
January 15, 2013 01:19
-
-
Save shadoi/4535156 to your computer and use it in GitHub Desktop.
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
irb(main):001:0> module MyMod; define_method(:foo) do |test='test', bah| puts test; puts bah; end; end | |
=> #<Proc:0x00000001bbb470@(irb):1 (lambda)> | |
irb(main):002:0> include MyMod | |
=> Object | |
irb(main):003:0> foo | |
ArgumentError: wrong number of arguments (0 for 1) | |
from (irb):1:in `block in <module:MyMod>' | |
from (irb):3 | |
from /usr/local/bin/irb:12:in `<main>' | |
irb(main):004:0> foo('asdf') | |
test | |
asdf | |
=> nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment