Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class My
- def value
- "hello world"
- end
- end
- m = My.new
- some_value = 21
- m.send(:define_method, :value) { some_value }
- m.value # => 21
- some_value = 42
- m.value # => 42 but I would like it to still be 21
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement