This is the abstract behavior class, every behavior in Raddish must extend from this object.


Methods

execute (method, context)

This method will execute the given method of the behavior.

Parameters

Name Type Description
method String the method to execute.
context CommandContext The context in which to execute the behavior.

Returned Value

CommandContext: The context after the method was executed.


getMethod (method)

This method converts a dot-separated method call to a function name.

Parameters

Name Type Description
method String The dot-separated method name.

Returned Value

String: A formatted function name.


hasMethod (method)

This method will check if a method exists or a method has been registred to the current call.

Parameters

Name Type Description
method String The dot-separated identifier of the called method.

Returned Value

Boolean: True when a method is found, else false.


registerMethod (method, target)

This method will register a function on a callable method.

Parameters

Name Type Description
method String The method to bind the function to.
target Function The function to execute.

Returned Value

Object: The current object for chaining.