Joel VanderWerf wrote:
> Oh, better watch out for evaluations with branches then:

Yes; as I said, it's not perfect (I guess a "perfect" solution just 
doesn't exist).

> calculate(:caption) do
>    case role
>    when PublicEmailRole
>      "#{self.role}: #{self.name} <#{self.email}>"
>    else
>      "#{self.role}: #{self.name}"
>    end
> end

At least it's relatively easy to fix: Just make sure you always 
reference all relevant cells. For instance,

calculate(:caption) do
   case role
   when PublicEmailRole
     "#{self.role}: #{self.name} <#{self.email}>"
   else
     self.email # dummy
     "#{self.role}: #{self.name}"
   end
end
-- 
Posted via http://www.ruby-forum.com/.