import GermanGoverness from 'kindergarten/src/kindergarten/governesses/GermanGoverness.js'
GermanGoverness
Extends:
German governess loves rules. She automatically guards all exposed methods.
This means that she calls guard()
and passes the name of the exposed
method as a first argument and arguments passed to exposed method as well.
Method Summary
Public Methods | ||
public |
governed(callback: *, args: *[], callingContext: *): * The overriden governed method of the HeadGoverness, that calls guard method before any exposed method is executed. |
Inherited Summary
From class PubSub | ||
public |
trigger(name: *, args: ...*): * Trigger all events synchronously by default |
|
public |
triggerAsync(args: ...*): * Trigger asynchronously |
From class HeadGoverness | ||
public get |
unguarded: * The getter of unguarded property. |
|
public set |
unguarded: * The setter of unguarded property. |
|
public |
rules: * |
|
public |
addRule(rules: ...*): * |
|
public |
doUnguarded(callback: *, context: *): * Perform some stuff unguarded |
|
public |
getRules(type: *): * |
|
public |
governed(callback: *, args: *[], callingContext: *): * Watch over some child action. |
|
public |
guard(action: *, args: ...*): * Throws an error if child is not allowed to do some action |
|
public |
hasAnyRules(): * The governess is empty when no rules have been defined |
|
public |
Returns true if child is allowed to perform some action |
|
public |
isGuarded(): * |
|
public |
isNotAllowed(args: ...*): * Returns false if child is allowed to perform some action |
|
public |
isUnguarded(): * |
|
public |
learnRules(perimeter: *): * |
Public Methods
public governed(callback: *, args: *[], callingContext: *): * source
The overriden governed method of the HeadGoverness, that calls guard method before any exposed method is executed. The first parameter passed to guard method will be the name of the exposed method. So make sure the name of exposed method and rule is the same when defining a perimeter.
Override:
HeadGoverness#governedParams:
Name | Type | Attribute | Description |
callback | * | ||
args | *[] |
|
|
callingContext | * |
|
Return:
* |