zaagan
12/11/2019 - 3:54 PM

Ruby Basics - BEGIN and END

Ruby Basics - BEGIN and END

END {
    puts "This will be called at the end."
}

puts "The will be called second."

BEGIN {
    puts "This will be called first."
}

# Output :
# This will be called first.
# The will be called second.
# This will be called at the end.