unless in Ruby on rails

By: Brian Marick  

The word “unless” is in the English language for a reason. Contrast “unless the judge is unfair, you’ll win” with “if the judge is not unfair, you’ll win.” Negations - especially negations of already negative ideas can be confusing. The same is true of Ruby code:

unless unfair(judge)

winner = you

end

if not unfair(judge)

winner = you

end

You can also use unless with the one-line form:

array.pop unless array.empty?




Archived Comments

1. I see your page needs some fresh content.
Writing manually takes a lot of time, but there is

View Tutorial          By: FrancineX at 2017-06-25 09:39:51

2. Incredible this is a handy websites.

[url=http://www.lyjyjft.com/comment/html/index.p

View Tutorial          By: http://www.essentielbio.us at 2017-06-09 08:47:34

3. Благодар&Ntild
View Tutorial          By: Http://ludovodka.ru at 2016-02-08 11:43:54

4. Unless the judge is unfair, you'll win??? Really that's the question.
If the judge is fair

View Tutorial          By: faker at 2012-05-07 05:41:45


Most Viewed Articles (in Ruby )

Latest Articles (in Ruby)

Comment on this tutorial