Which language is this?
It's just a pseudocode based on Ruby.
Interesting. Few languages have this feature. So does that make the function an actual method but outside the class?
I edited by replacing function with def keyword.
Basically, instead of making class as global, use more functions as global primitives.
And where do you put these functions?
Put those right in Ruby files. Then when you require that file, you can use your functions.
So just one extra file where you put all functions (or methods in this case) related to that class?
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.