On Sun, Jun 28, 2009 at 10:18 AM, David A. Black<dblack / rubypal.com> wrote:
> At the risk of someone saying that I've made it too cryptic, it could
> be one line shorter:
>
>   
>    
>     >  
>

Actually the second line IS necessary

Nothing = Object.new
 def name(value = Nothing)
   @name = value unless value == Nothing
 end

 name 42 # => 42
 name # => nil



-- 
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale