12 ways to call a method in Ruby
20-Aug-2020 1573
Today during a chat with one of my colleagues we discussed agreeing on certain ways to write our Python code. We joked about how Python follows this idea of having exactly one way to do each thing (which is usually followed by the language, but not necessarily by libraries). It made me think about Ruby, which has opposite philosophy - everything can be done in many different ways.This led me to a random idea of checking in how many different ways I can call a single method in Ruby. I ended up with 12 different ways (a couple are a bit of cheating). Prepare for some surprises below - especially the last one is mind blowing!.
12 ways to call a method in Ruby #ruby #rubydeveloper #rubyonrails #method https://rubyonrails.ba/link/12-ways-to-call-a-method-in-ruby