D’oh… Ruby is so simple and intuitive (for a “empty” brain that is)
that it actually makes it really hard for me… I’m always trying to do
stuff like I’d do in PHP or in other languages.
Thanks Craig & Robert. Hendie, that’s what I was doing at first, but I
think you’ve already realized why it doesn’t always work
Using boolean short-circuit operators is not language specific. It’s
more
idiomatic. So, while you might be more likely to write the code below in
PHP, it would also work if you wrote:
function ep_is_sysop(){
return (!empty($_SESSION[‘user’] && $_SESSION[‘user’] == ‘siteop’);
}
That’s not to say you should use PHP. Just that you can use some similar
constructs to this.