Module: context

Context

Source:

Methods

(inner) contextInstance(contextTypeName, id, code) → {ContextInstance}

Return a context object (i.e. a program object).

Parameters:
Name Type Description
contextTypeName string

The context type name (e.g., programs). This should be plural.

id number

The ID for the context

code string

v5 uses program_code instead of program_id

Source:
Returns:

Returns context instance object.

Type
ContextInstance

(inner) contextType(context) → {ContextType}

A context is a top-level actor in the RewardOps API.

NOTE: Currently, there is only one type of context ('programs')

Parameters:
Name Type Description
context string

The name of the context type ('programs')

Source:
Returns:

Returns context type object.

Type
ContextType

Type Definitions

ContextInstance

Context instance type definition

Type:
  • object
Properties:
Name Type Description
contextTypeName string

See contextInstance

id number

See contextInstance

handle function

Context handler function

Source:

ContextType

Context type type definition

Type:
  • object
Properties:
Name Type Description
context string

Context value

getAll function

Method that returns an array of context objects (e.g., programs)

get function

Method that returns a context object (e.g., program)

Source: