Check empty? of variable for Case/When

I have this:

case child.name
when @collection.location_tag
@article.location = child.content
when @collection.content_tag
@article.content = child.content
when @collection.docno_tag
@article.docno = child.content
when @collection.date_tag
temp_date = child.content
end

is there a way to check whether the @collection.attributes are empty
or not before to evaluate them in the “When” clause?

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

2009/12/22 adedip [email protected]:

      temp_date = child.content
end

is there a way to check whether the @collection.attributes are empty
or not before to evaluate them in the “When” clause?

I don’t understand what you mean, can you be more explicit?

Colin

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.