runtime/global/variables.rb

tests/_examples/runtime/global/variables.rb in the metorex repository.

# Global variables with $ prefix
$count = 0

def increment
  $count = $count + 1
end

increment
increment
increment
puts $count

$message = "hello"
puts $message

Output:

3
hello