I just found this out today which is pretty sweet. Sometimes I need a symbol but compose it using a string and then call to_sym on that. Turns out there’s a shorter more concise way of doing this:
@ivar2 = "_two"
:"my_string#{@ivar2}"
This returns a symbol :my_string_two. Pretty cool I thought.
June 2008 (1)
May 2008 (1)
April 2008 (2)
March 2008 (4)
February 2008 (1)
January 2008 (1)
December 2007 (2)
November 2007 (5)
October 2007 (3)
September 2007 (4)
August 2007 (1)
Online journal of Jonathan Conway a twenty something technologist, entrepreneur, husband, daddy of two, oh and lead architect at vzaar. Currently residing in London, UK.
You can find a little bit more about me here
My tumbler
vzaar
Brightbox Rails Hosting
My Caboose Facebook Profile
New Bamboo
Luke Redpath
Jamie Van Dyke
Peter Cooper
Ismael
Caroline
Monster Gym
Scala
Pat Allan
Cristi Balan

wtf?!?! RoR swear words!
January 15th, 2008 at 11:40 AM
;)
January 16th, 2008 at 08:52 PM