global

This module supports you to store data globally.

use global

global.a = 10
global.b = 20

puts global.a + global.b

Shorten?

use _ as 'global'

_.a = 'Hi'
_.b = 'Halo'

In fact, you can create your own global by using map.

store.no
return {}
main.no
use store

store.name = 'John'
store.email = 'john@example.com'

Last updated

Was this helpful?