API Docs for: 1.0.1

Grape.Object Class

Defined in: js\grape\class.js:6

A fake class to represent default class methods

Item Index

Methods

Properties

Methods

extend

(
  • [name]
  • [methods]
)
Class static

Creates a new class, which extends this class. X.extend(a, b) is the same as Grape.Class(a,X,b)

Parameters:

  • [name] String optional

    The class name

  • [methods] Object optional

    Class methods

Returns:

Class:

The new class

extends

(
  • clazz
)
Boolean static

Tells whether the given class is a parent of the current class.

Parameters:

  • clazz Class

    The class

Returns:

Boolean:

true, if the given class is a parent

getClass

() Class

Returns the instance's constructor class

Returns:

Class:

instanceOf

(
  • clazz
)
Boolean

Tells that the current instance is an instance of a class, or it's descendants.

Parameters:

  • clazz Class

Returns:

Boolean:

true, if yes.

parent

(
  • clazz
  • method
)
Function

Creates a proxy for calling a parent method

Parameters:

  • clazz Class

    The parent, whose method will be called

  • method String

    Method name

Returns:

Function:

Method proxy. When called, calls the parent method with the parameters, and original context.

Properties

className

String static

The name of the class if set, or a generated string.

id

Number static

An unique number for the class, mainly for indexing purposes