Class examples

 

Class definition

A class definition, which makes a class available for later use.

class ntp {
  package {'ntp':
    ...
  }
  ...
}

For details about class usage and syntax, see Classes.

Class declaration

Declaring the ntp class in three different ways:

  • the include function
  • the require function

  • the resource-like syntax

Declaring a class causes the resources in it to be managed.

The include function is the standard way to declare classes:

include ntp

The require function declares the class and makes it a dependency of the code container where it is declared:

require ntp

The resource-like syntax declares the class and applies resource-like behavior. Resource-like class declarations require that you declare a given class only one time.

class {'ntp':}

For details about class usage and syntax, see Classes.