Skip to content

Instantly share code, notes, and snippets.

@gumayunov
Last active December 11, 2015 04:38
Show Gist options
  • Save gumayunov/4545947 to your computer and use it in GitHub Desktop.
Save gumayunov/4545947 to your computer and use it in GitHub Desktop.
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