| 1 |
name: bool |
| 2 |
long_name: Boolean |
| 3 |
description: A boolean object which is either `true` or `false` |
| 4 |
|
| 5 |
methods: |
| 6 |
- name: to_int |
| 7 |
returns: int |
| 8 |
description: Returns `1` if `true` and `0` if `false` |
| 9 |
|
| 10 |
- name: to_string |
| 11 |
returns: str |
| 12 |
description: | |
| 13 |
Returns the string `'true'` if the boolean is true or `'false'` otherwise. |
| 14 |
You can also pass it two strings as positional |
| 15 |
arguments to specify what to return for true/false. For instance, |
| 16 |
`bool.to_string('yes', 'no')` will return `yes` if the boolean is |
| 17 |
true and `no` if it is false. |
| 18 |
|
| 19 |
optargs: |
| 20 |
true_str: |
| 21 |
type: str |
| 22 |
default: "'true'" |
| 23 |
description: The string to return when the boolean is `true` |
| 24 |
|
| 25 |
false_str: |
| 26 |
type: str |
| 27 |
default: "'false'" |
| 28 |
description: The string to return when the boolean is `false` |