/**
* Assigns callback functions to the class, the $methods array should be an associative one, where
* the keys are the method names, while the values are the closure functions, e.g.
*
* array(
* 'onBeforeMove' => function(){ return 'Foobar'; }
* )
*
* @param Observable $subject
* @param array $methods
*/
public function __construct(Observable &$subject, array $methods = array())
{
parent::__construct($subject);
foreach ($methods as $method => $function) {
$this->methods[$method] = $function;
}
}