Showing posts with label ruby compare if and unless. Show all posts
Showing posts with label ruby compare if and unless. Show all posts

Monday, March 19, 2012

Comparison between ruby if and unless


1.9.2-p290 :035 > unless false
1.9.2-p290 :036?>   puts 'a'
1.9.2-p290 :037?>   else
1.9.2-p290 :038 >     puts 'b'
1.9.2-p290 :039?>   end
a
 => nil
1.9.2-p290 :040 > if false
1.9.2-p290 :041?>   puts 'a'
1.9.2-p290 :042?>   else
1.9.2-p290 :043 >     puts 'b'
1.9.2-p290 :044?>   end
b