Skip to content

Instantly share code, notes, and snippets.

Created February 11, 2016 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/758baf5eee3d60564ebd to your computer and use it in GitHub Desktop.
Save anonymous/758baf5eee3d60564ebd to your computer and use it in GitHub Desktop.
class myobj
attr_accessor :test
def initialize
@test = nil
end
end
obj = myobj.new
str = 'test'
#this works
obj.send "#{str}=", 12
#but i need this to work as well
obj.send "#{str}+=" 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment