I run into a lot of situations where I'm modifying a variable with a method and setting it to that modified value e.g...
value = "string"
value.modify #=> "new string"
value #=> "string"
value = value.modify
value #=> "new string"
I noticed that many Ruby methods have a value.modify! varient that does just that.
Is there a shorthand in Ruby for doing value = value.modify?
Also if I was ever to make my own modify! method how would I go about implementing it?
var = var.methodor similar isn't all that bad. There are bigger, worse code issues to worry about.