Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 226 Bytes

as_a_suffix.md

File metadata and controls

14 lines (10 loc) · 226 Bytes

As a suffix

An if can be written as an expression’s suffix:

a = 2 if some_condition

# The above is the same as:
if some_condition
  a = 2
end

This sometimes leads to code that is more natural to read.