First of all, there is nothing magic about it. Ruby has a reputation for being magic but it’s just a regular Ruby method, just like you can define for your own stuff. You can see it here yourself. It certainly is not simple, and is written by folks with a deep understanding of the language, but not magic. While it can feel like magic if you don’t understand it, just keep in mind there is nothing magic going on under the hood. Just clever use of the language to make it a better experience for the users of that method. If you ever want to understand it, it’s all open source so dig in. Reading other people’s code is one of the best ways to learn.
As @D-system said, the formatting is just an esthetic preference. The creator of Ruby has a stated goal of making the programmer “to be happy”:
I hope to see Ruby help every programmer in the world to be productive, and to enjoy programming, and to be happy. That is the primary purpose of Ruby language - Matz
Towards that goal, it is a very malleable language, including the syntax. Things like semi-colons on the end of the line, parens for meth calls (or definitions) are often optional. I think the idea is, flexibility means it can be what the programmer wants it to be, making the programmer happy.
Some folks are bothered by that level of flexibility. They are used to languages that have a very restrictive syntax. Therefore they have layered their own rules they follow on top of the language. This is OK also. While I prefer to make use of the flexibility of Ruby (even wrote an article on the topic a while back), if you want to write it how you suggested because that feel more comfortable to you then go for it! If it makes you happy then you are achieving the primary purpose of Ruby.
As to those specific aesthetic choices, a lot of Rubyist who like a more restrictive syntax are heavily influenced by a tool called Rubocop which in turn is influenced by something called the Ruby Style Guide. This tool will highlight (and often even automatically fix) deviations from the Ruby Style Guide. Specifically the argument alignment and method call with arg paretheses rules lead to the formatting you saw.
Rubocop is a great tool. Especially the metrics and security related cops. But IMHO it’s style and layout related cops are over-zealous. Whoever wrote that tutorial might be following that style guide more strictly than I would have. Follow that guide (or any other) if you want, but feel free to do it your way also if you want. I know I do. And it’s not just me. Even the creator of Ruby once said:
The default setting of RuboCop is very much different from my preference, and some of its rules puzzle me
Rails just recently started incorporating Rubocop and it also is defaulting to disabling many of Rubocop’s rules and only enabling a few that it finds useful so you are in good company if those rules don’t line up to your preferences.