Execution order of ruby programs

Time:2020-4-23

1. Search the begin statement first, and execute if found, otherwise execute the first line of the program

2. When the function definition, class definition and module definition are encountered, they are executed, resulting in the definition of these things

3. When the statement that causes the program to exit is encountered, or at the end of the file or when the “end” is encountered, the program exits execution

4. Before exiting the execution, a typical end statement block or exit hook statement registered by at_exit is executed. However, if the exit caused by exit!, the first two cases do not execute

Recommended Today

On the kernel of time series database: how to carry 100 million data writing with a single machine

This article was first published inDevelopment paper:https://www.jianshu.com/u/204b8aaab8ba edition date remarks 1.0 2021.10.19 Article launch 1.0 2021.11.21 Supplement the content added when sharing in the company 0. Background The title comes from the background introduction of the birth of their storage engine by influxdb: The workload of time series data is quite different from normal database […]