Ruby modules and extend self -
In what sort of code the code is:
Module M extends the DF greetings itself "Hello" and end
Use something more beneficial to use:
Module M def self.greet puts "hello" end of end
On the top, one example example is being expanded, and later only there is a class method, but when you call any method, then you have to make an M. graph Hoog , Is not it? I was just curious if someone could put some light on another using a code thanks!
The first example is usually a way for people to get the functionality of module_function
(When they do not know the existence of this method).
A
Comments
Post a Comment