-
Notifications
You must be signed in to change notification settings - Fork 3
Enabling Features
mosop edited this page Nov 19, 2016
·
8 revisions
Callback.enable
defines a callback!
macro method into a specified class. The callback! method enables the class to use the Crystal Callback features.
require "callback"
Callback.enable Reference
class MyClass
callback!
end
You can also limit the scope.
require "callback"
class MyClass
Callback.enable MyClass
callback!
end
class AnotherClass
callback! # raises a compile error
end