“...I've been working since 2008 with Ruby / Ruby on Rails, love a bit of Elixir / Phoenix and learning Rust. I also poke through other people's code and make PRs for OpenSource Ruby projects that sometimes make it...”

Rob Lacey
Senior Software Engineer, Copenhagen, Denmark

Ruby &&

Old blog posts I never published, except I have now #1

I really like that the && operator in Ruby returns the final argument, or the result of the last evaluation

rl@bloodandguts:~/repos$ irb
>> "take" && "give"
=> "give"
>> "take" && "give" || "take" && "blum"
=> "give"
>> "take" && false || "take" && "blum"
=> "blum"
> "take" && Numeric.new || "take" && "blum"
=> #<Numeric:0x7f2841bffa70>