ProAct.DSL.predefined.mapping Class
src/js/dsl/dsl.js:359
A set of predefined mapping operations to be used by the DSL.
Item Index
Methods
!
-
value
Toggles a boolean value. If the value is true
it becomes false
and vice versa.
Usage in a DSL expression:
map(!)
Parameters:
-
value
BooleanA boolean value.
Returns:
The opposite of value
.
&.
-
methodName
Mapping operation for calling a method of an object.
Usage in a DSL expression:
map(&.&go)This will call the 'target.go' method and use its result.
Parameters:
-
methodName
StringThe method name to call.
Returns:
The result of the method call.
-
-
n
Mapping operation for changing the sign of a number to the oposite.
For example 4 becomes -4 and -5 becomes 5.
Usage in a DSL expression:
map(-)
Parameters:
-
n
NumberThe number which will have its sign inverted.
Returns:
The same number as n
, but with opposite sign.
eventToVal
-
event
Mapping operation for turning value event in its value.
Usage in a DSL expression:
map(eventToVal)
Parameters:
-
event
EventThe value event to get the new value from.
Returns:
The value.
int
-
str
Mapping operation for turning an string to a decimal Number - integer.
For example '4' becomes 4.
Usage in a DSL expression:
map(int)
Parameters:
-
str
StringThe string to convert to integer.
Returns:
The integer representation of str
.
pop
()
Event
static
Mapping operation for turning value in an ProAct.Array pop event.
Usage in a DSL expression:
map(pop)
Returns:
Pop event.
pow
-
n
Mapping operation for computing the square of a number.
For example 4 becomes 16.
Usage in a DSL expression:
map(pow)
Parameters:
-
n
NumberThe number to power.
Returns:
The square of n
.
shift
()
Event
static
Mapping operation for turning value in an ProAct.Array shift event.
Usage in a DSL expression:
map(shift)
Returns:
Shift event.
sqrt
-
n
Mapping operation for computing the square root of a number.
For example 4 becomes 2.
Usage in a DSL expression:
map(sqrt)
Parameters:
-
n
NumberThe number to compute the square root for.
Returns:
The square root of n
.