Skip to main content
Version: v0.21.0

Nil

Nil is the representation of "nothing". It will be returned if something returns nothing (eg. puts or an empty break/next) and can also be generated with 'nil'.

Literal Specific Methods​

plz_f()​

Returns FLOAT

Returns zero float.

nil.plz_f()
Output
0.0

plz_i()​

Returns INTEGER

Returns zero integer.

nil.plz_i()
Output
0

plz_s()​

Returns STRING

Returns empty string.

nil.plz_s()
Output
""

Generic Literal Methods​

methods()​

Returns ARRAY

Returns an array of all supported methods names.

"test".methods()
Output
["upcase", "find", "format", "reverse", "split", "replace", "strip!", "count", "reverse!", "lines", "downcase!", "upcase!", "size", "plz_i", "strip", "downcase"]

to_json()​

Returns STRING|ERROR

Returns the object as json notation.

a = {"test": 1234}
a.to_json()
Output
{"test": 1234}
"{\"test\":1234}"

type()​

Returns STRING

Returns the type of the object.

"test".type()
Output
"STRING"

wat()​

Returns STRING

Returns the supported methods with usage information.

true.wat()
Output
"BOOLEAN supports the following methods:
plz_s()"