Module

context

Context

View Source context.js, line 1

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

View Source context.js, line 136

Returns context instance object.

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')

View Source context.js, line 22

Returns context type object.

ContextType

Type Definitions

object

# ContextInstance

Context instance type definition

Properties:
Name Type Description
contextTypeName string

See contextInstance

id number

See contextInstance

function

View Source context.js, line 146

object

# ContextType

Context type type definition

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)

View Source context.js, line 117