This way help me to make tiny utility function.
Following codes are the way.
- module MyModule
- class Utility
- def Utility.writingSignLine(f)
- f.print "#"
- for i in 0...77
- f.print "="
- end
- f.print "\n"
- end
- end
- end
Keynote is the 3 line.
This line expresses to define next codes as class method code.
Calling way is simple.
It's next!
- f = open(file_name, "w")
- MyModule::Utility::writingSignLine(f)
 


No comments:
Post a Comment