I am new to Ruby. I'm looking to import functions from a module that contains a tool I want to continue using separately. In Python I would simply do this:
def a():
...
def b():
...
if __name__ == '__main__':
a()
b()
This allows me to run the program or import it as a module to use a()
and/or b()
separately. What's the equivalent paradigm in Ruby?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…