It seems that I have to place all the methods I have created at the top
of my script in order to be able to call them later on in the script.
Is there a way for me to put all my methods at the bottom of the script
and still be able to call them at the top of the script?
Thanks
John
Hello.
As Ruby in an ObjectOriented programming language, it’s best not to
create unbound methods, but to encapsulate them as class methods, and
then you can just instantiate the class, and do all the work in the
initialize method. Order of method declarations in class is not
important (unless you use meta-programming tricks), so you can have your
initializer at the top of the class.
If you don’t want to do it like this, you can just write your main code
in a separate method at the beginning of your script, and just call the
method (one line) at the very bottom.