Last active
December 11, 2015 04:38
-
-
Save gumayunov/4545947 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
module ReverseField | |
def field=(value) | |
value = value.reverse | |
super | |
end | |
end | |
class C | |
include ReverseField | |
attr_accessor :field | |
end | |
i = C.new | |
i.field = "123" | |
puts i.field | |
# 123 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment