Class zebkit.Class.zObject <zebkit>




public <Function> $getSuper (name)

Get a first super implementation of the given method in a parent classes hierarchy.


Parameters:
  • name <String>

    a name of the method


Returns: <Function>

a super method implementation

public <Object> $super ([superMethod], [args])

Call super method implementation.


Parameters:
  • [superMethod] <Function>

    ? optional parameter that should be a method of the class instance that has to be called

  • [args] <Object> (*..n)

    arguments list to pass the executed method


Returns: <Object>

return what super method returns


Example:

var A = zebkit.Class([ function a(p) { return 10 + p; } ]);

var B = zebkit.Class(A, [ function a(p) { return this.$super(p) * 10; } ]);

var b = new B(); b.a(10) // return 200

public void extend ([interfaces], methods)

Extend existent class instance with the given methods and interfaces For example:

   var A = zebkit.Class([ // declare class A that defines one "a" method
       function a() {
           console.log("A:a()");
       }
   ]);

   var a = new A();
   a.a();  // show "A:a()" message

   A.a.extend([
       function b() {
           console.log("EA:b()");
       },

       function a() {   // redefine "a" method
           console.log("EA:a()");
       }
   ]);

   a.b(); // show "EA:b()" message
   a.a(); // show "EA:a()" message

Parameters:
  • [interfaces] <zebkit.Interface> (*..n)

    interfaces to be implemented with the class instance

  • methods <Array>

    list of methods the class instance has to be extended with