
reference.language.category_methods.html Maven / Gradle / Ivy
Methods
Methods
Prompto supports both global methods and category methods.
In this section, we describe category methods only, global methods are described in the Methods section.
Category and global methods have a lot in common, so most of the information is the same for both type of methods, and may seem redundant.
There are however some differences:
The current object i.e. this
or self
:
Category methods are executed in the context of a category instance. This instance can be addressed using the this
or self
keyword.
The current object is implicit, there is no need to pass it as a parameter.
Method overriding:
Derived categories inherit the methods defined in their parents. Prompto supports re-defining these methods in derived categories. This is called method overriding.
Abstract methods:
Abstract methods are only supported by abstract categories. Concrete derived categories must provide an implementation of inherited abstract methods.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy