

Be sure to check out our new visualizer we have on display there if you haven’t yet!


Be sure to check out our new visualizer we have on display there if you haven’t yet!
Dear friends, family, close relations, guys, gals, second cousins twice removed, and the web a large,
I’m moving. Moving to sunny, sunny California. I’m kinda flying by the seat of my pants right now, but I’ll initially be in Palo Alto for about 3 months, staying with Jesse, and then it’s a hop, skip, and a jump into SF.

I’m very excited to announce that I’ve joined the team at Obvious, who of course made something called Odeo, to work on Twitter. I landed at Twitter for a number of reasons, but most importantly because I love and use it, as well as truly believe in what we’re working on. Twitter allows me (and you!) to talk about all the oddities of life, of which there are most definitely plenty. It provides an outlet for that strange little voice in your head that normally lies silent. The one that should at times stay quiet, but often wants to jump up and down and scream something like “HEY! Why is the mall Santa running through my neighborhood naked with a bottle of scotch!?”
Twitter the site aside, I’ll be joining an absolutely stunning team of passionate and creative people. I’ll also be leaving the same here in Lexington. I truly love the people at Voltaic, and words escape me in trying to describe the time I’ve spent there. I will miss them very much.
Anyway, enough for now. Lots of exciting stuff coming up!
This has been covered elsewhere. I did it in the past, but of course life has a way of kicking out old info to make space for the new.
Without being too terribly long winded, I will say that the reason for making this post is due to the fact that when I wanted to figure out how to dynamically create variables with ruby, I did a google search for a number of derivations of: ruby programmatically creating variables. This came up with a lot of nothing. I quickly realized this was turning into one of those dreaded cases of having to know the method name you’re looking for before you can find it. I’m a bit embarrassed to say I didn’t check this one, but thanks to blink on #ruby-lang, I’m posting just incase someone else searches with the same terms.
So at its very simplest:
eval "ans = 42"
Read more about eval at Jim Weirich’s always excellent blog.
Furthermore, instance variables of a class can be set via set_instance_variable.
class DeepThought
end
question = DeepThought.new
question.instance_variable_set("@ans", 42)
def question.what_is_the_answer
return @ans
end
question.what_is_the_answer
=> 42