Skip to content

Instantly share code, notes, and snippets.

@mcordell
Created July 2, 2016 05:44
Show Gist options
  • Save mcordell/968c00c2bae72cdba257d94b3b473d9d to your computer and use it in GitHub Desktop.
Save mcordell/968c00c2bae72cdba257d94b3b473d9d to your computer and use it in GitHub Desktop.
module Global
def plugins
yield
end
def register(value)
@value = value
end
def value
@value
end
end
module ROM
extend Global
plugins do
register(2)
end
end
ROM.value
#=> 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment