From: Reimer Behrends Date: 2002-11-20T08:31:07+09:00 Subject: Re: begin/end doesn't behave as expected Tim Bates (news@bates.id.au) wrote: [...] > > T> I think a case statement will do what you want here.. > > How would I use a case statement here? I'm comparing two different things, > namely rule.instance_of? and page.nil? [...] > out << begin > "error.rb" > "rules.rb" if rule.instance_of? Rule > "dead.rb" if rule.instance_of? DeadRule > "proposals.rb" if rule.instance_of? Proposal > page.to_s unless page.nil? > end out << if page then page.to_s else case rule # Note: not rule.type when Proposal then "proposals.rb" when DeadRule then "dead.rb" when Rule then "rules.rb" else "error.rb" end end Untested, but you get the idea. [...] Reimer Behrends