Class zebkit.Interface <zebkit>

Interface is way to share common functionality by avoiding multiple inheritance. It allows developers to mix number of methods to different classes. For instance:

 // declare "I" interface that contains one method a
 var I = zebkit.Interface([
     function a() {

     }
 ]);

 // declare "A" class
 var A = zebkit.Class([]);

 // declare "B" class that inherits class A and mix interface "I"
 var B = zebkit.Class(A, I, []);

 // instantiate "B" class
 var b = new B();
 zebkit.instanceOf(b, I);  // true
 zebkit.instanceOf(b, A);  // true
 zebkit.instanceOf(b, B);  // true

 // call mixed method
 b.a();
Constructor:
zebkit.Interface ([methods])

Parameters:
  • [methods] <Array>

    list of methods declared in the interface


Returns: <Function>

an interface




private <zebkit.Interface> $clone ( )

Private implementation of an interface cloning.


Returns: <zebkit.Interface>

a clone of the interface