Created
January 9, 2019 02:14
-
-
Save worldofprasanna/7de525292b7701c236fec9d7c50ae6b0 to your computer and use it in GitHub Desktop.
For blog on things I like about ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Functions with ? | |
| a = 0 | |
| a.zero? | |
| a.nil? | |
| # Loop statement | |
| 10.times do | |
| puts "Hello Ruby !!!" | |
| end | |
| # Conditional statement | |
| puts "zero" if a.zero? | |
| # All expression returns value | |
| b = if a.zero? | |
| "free" | |
| else | |
| "paid" | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment