As Chris Jet-Young says, it requireshould be all you need. However, you can use a simple ifor “turn on” protector if you want to make it one, for example:
unless defined? FooGuard
FooGuard = true
... rest of code ...
end
You can do anything in the body if, including defining classes, methods, etc.
source
share