open class Plugin : Observable
Base class of a Ripe Plugin.
Plugin(options: Map<String, Any>?)
Base class of a Ripe Plugin. |
open val options: Map<String, Any>?
A map with options to configure the plugin. |
|
var owner: Ripe?
The Ripe instance that is using this plugin. |
val callbacks: MutableMap<String, MutableList<ObservableCallback>>
A dictionary that contains all methods to be executed when an event is triggered |
open fun register(owner: Ripe): Unit
Registers this plugin to the provided Ripe instance. |
|
open fun unregister(): Unit
Unregisters this plugin from its owner. |
fun addCallback(event: String, callback: ObservableCallback): ObservableCallback
Binds to an event by providing a block that will receive the event payload as a parameter and return a Deferred that will be completed asynchronously. |
|
fun bind(event: String, callback: (args: Map<String, Any>) -> Unit): ObservableCallback
Binds to an event by providing a block that will receive the event payload as a
parameter. The block will be executed synchronously, for costly operations prefer
the use of |
|
fun bindAsync(event: String, callback: ObservableCallback): ObservableCallback
Binds to an event by providing a block that will receive the event payload as a parameter and return a Deferred that will be completed asynchronously. |
|
fun bindSync(event: String, callback: (args: Map<String, Any>) -> Unit): ObservableCallback
Binds to an event by providing a block that will receive the event payload as a
parameter. The block will be executed synchronously, for costly operations prefer
the use of |
|
fun removeCallback(event: String, callback: ObservableCallback?): Unit
Unbinds the provided callback from an event. |
|
fun runCallbacks(event: String, args: Map<String, Any> = HashMap()): Deferred<List<Any?>>
Triggers the event by calling all its bound callbacks with args as parameters. |
|
fun trigger(event: String, args: Map<String, Any> = HashMap()): Deferred<List<Any?>>
Triggers the event by calling all its bound callbacks with args as parameters. |
|
fun unbind(event: String, callback: ObservableCallback?): Unit
Unbinds the provided callback from an event. |
class SyncPlugin : Plugin
Plugin responsible for applying synchronization rules. |