Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class FooBar
- def method_missing(meth, *args)
- puts "#{meth} ble kalt med #{args}"
- # her hadde det f.eks. gått ann å dynamisk legge til metoder
- end
- end
- irb(main):002:0> f = FooBar.new
- => #<FooBar:0xb7da1cc4>
- irb(main):003:0> f.test
- test ble kalt med
- => nil
- irb(main):004:0> f.test "ape"
- test ble kalt med ape
- => nil
Add Comment
Please, Sign In to add comment