Methods in Ruby
Ruby supports methods defined on struct-like objects called classes.
To run the program:
In Ruby, all methods are defined on classes or modules, and they always operate on the instance of the class (the object). There’s no need to explicitly define receiver types as in some other languages.
Ruby doesn’t have the concept of pointer and value types like some other languages. All variables in Ruby are references to objects. When you assign an object to a new variable or pass it to a method, you’re creating a new reference to the same object, not copying the object itself.
Next, we’ll look at Ruby’s mechanism for grouping and naming related sets of methods: modules and mixins.