Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyClass
- def initialize(num)
- @num = num
- end
- MyClass.class_eval do
- def num
- @num
- end
- end
- end
- a=MyClass.new(1)
- a.num
- .....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement