aboutsummaryrefslogtreecommitdiff
path: root/api/booleans.yaml
blob: 0831ac18cd72f07da863b06c61b1231e864fec27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Bool.parse:
  short: parse into boolean
  description: >
    Converts a text representation of a boolean value into a boolean. Acceptable
    boolean values are case-insensitive variations of `yes`/`no`, `y`/`n`,
    `true`/`false`, `on`/`off`.
  return:
    type: 'Bool?'
    description: >
      `yes` if the string matches a recognized truthy boolean value; otherwise return `no`.
  args:
    text:
      type: 'Text'
      description: >
        The string containing the boolean value.
  example: |
    >> Bool.parse("yes")
    = yes : Bool?
    >> Bool.parse("no")
    = no : Bool?
    >> Bool.parse("???")
    = none : Bool?