Site menu

CodeCook.io

  • Languages
    • C
    • C++
    • CSS
    • Git
    • HTML
    • Java
    • JavaScript
    • jQuery
    • PHP
    • Python
    • Ruby
    • Scala
  • control
  • else
  • if

Ruby - If else

Execute different sections of code depending whether condition is true or false.

0
483
  • Share on Facebook
  • Share on Google+
  • Share on Twitter
if {{condition}}
  {{true_code}}
else
  {{false_code}}
end
ruby

Notes

last update: Oct. 27, 2014

Advertisement

This project is hosted on DigitalOcean, try it and support us

Other language

  • Python
  • PHP

Random task

  • key value list all keys
  • Prepend item to list
  • List branches on machine
  • List installed apache2 modules
  • Check if specific commit is on remote
  • Blog
  • About
  • License