Self (Expression) — ClassySK

Addon: ClassySK · Category: Expression · Since: 1.0.0

Syntax

self

Description

Only available in non-static methods. Refers to the current class instance from whatever method is running it, Allowing your code to behave differently depending on what instance is running it.

Examples

class MyClass:
	private counter: integer

	public getCount() :: integer:
		return self::counter

	public increaseCounter():
		add 1 to self::counter

View source