Random Stuff
This commit is contained in:
@@ -16,6 +16,7 @@ bool_f = false
|
||||
nil_val = nil
|
||||
|
||||
|
||||
|
||||
# --- Strings and symbols
|
||||
s1 = "double-quoted string with escape\nand interpolation: #{int_lit}"
|
||||
s2 = 'single-quoted string with \\n literal'
|
||||
@@ -382,15 +383,6 @@ hex = 0xff
|
||||
oct = 0o755
|
||||
bin = 0b101010
|
||||
|
||||
# --- Case with guards
|
||||
val = 10
|
||||
case val
|
||||
when Integer if val.even?
|
||||
case_guard = :even_int
|
||||
else
|
||||
case_guard = :other
|
||||
end
|
||||
|
||||
# --- Ternary, safe nav, assignment forms
|
||||
tern = val > 5 ? :big : :small
|
||||
safe_len = nil&.to_s&.length
|
||||
|
||||
Reference in New Issue
Block a user