Class: BlockInfo

PodJS. BlockInfo

Information about a block provided by a Pod, including which resource types it is compatible with and what parameters are accepted. Note that the object provided does not have to extend from this object - it must merely have the same properties.

new BlockInfo()

Source:

Classes

ParameterInfo

Members

blockType :string

Name of the block type
Type:
  • string
Source:

description :string

Description of this block
Type:
  • string
Source:

parameterInfo :PodJS.BlockInfo.ParameterInfo[]

Description of Ordered list of parameters accepted by this block. If this property is not present, it is assumed the block requires no parameters.
Type:
  • PodJS.BlockInfo.ParameterInfo[]
Source:

returnsValue :boolean

If true, this block is a reporter block (i.e. it returns a value, either a number or a string). The block will return a value from its tick method. Else, if false, the tick method will return undefined.
Type:
  • boolean
Source:

Methods

compatibleWith(resource) → {boolean}

Returns true if this block is compatible with the specified resource, or false if not.

If not compatible, the PodJS.ScriptBuilder will refuse to attach the block to the resource.

The default implementation of this method is to return true. Subclasses must override if the block will not work with all resources. If an object is provided with no compatibleWith method, it is assumed the block is compatible with all resources.

Parameters:
Name Type Description
resource PodJS.Pod#Resource The resource to check for compatibility.
Source:
Returns:
True if the block is compatible, or false if not.
Type
boolean

reset(context)

Optional function to reset the state of the block. If present, this will be called whenever the script is reset.
Parameters:
Name Type Description
context PodJS.Pod#BlockContext So that the block can have access to its environment, etc. during reset.
Source: