DEV Community

es404020
es404020

Posted on

1 1

Ruby Conditional Statements

In this post we look at if, else, elsif statement .This are the conditional operation which perform an action based on the Boolean response it pretty straight forward to use

state=true

if state
  puts "you pick true"
elsif !state
  puts "you pick false"
else 
  puts "nothing was picked"

end


Enter fullscreen mode Exit fullscreen mode

That all thanks for reading

Top comments (0)

Cloudinary image

Video API: manage, encode, and optimize for any device, channel or network condition. Deliver branded video experiences in minutes and get deep engagement insights.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay