Skip to contents

Declare a method or attribute as private.

The private function is used to declare a method or attribute as private in a class definition.

Private methods and attributes are not accessible from outside the class, and are used to encapsulate data that should not be modified directly.

Usage

private_(attribute)

Arguments

attribute

The function or attribute to be declared as private.