Weekly tips

Squadracer shares a tip every week. We start this series in Ruby!

percent literal

Yes, this piece of code is perfectly correct!

Alexandre Borderes
Alexandre Borderes

cycle 🔄

You'll go round in circles!

Alexandre Borderes
Alexandre Borderes

nonzero?

The opposite of zero?... Well, not exactly!

Alexandre Borderes
Alexandre Borderes

dig ⛏️

Need a pick?

Alexandre Borderes
Alexandre Borderes

split

A special case to be aware of

Alexandre Borderes
Alexandre Borderes

clamp

A bounded method!

Alexandre Borderes
Alexandre Borderes

binding.irb

IRB for Interactive RuBy

Alexandre Borderes
Alexandre Borderes

none? one? any? all?

How they really work

Alexandre Borderes
Alexandre Borderes

command-line

Ruby is also very comfortable in scripting mode. It can replace `sed`, `grep`, `awk`, ...

Alexandre Borderes
Alexandre Borderes