error_type のフィールドとメソッド
フィールドは、値についての単純な事実で、ドットを使い角括弧なしで読み取ります: $value.name。メソッドは引数を取るか処理を行い、-> で呼び出します: $value->name(arguments)。または、値をパイプで渡して呼び出します: $value |> name(arguments)。
フィールド
| フィールド | 型 | 説明 |
|---|---|---|
.description | string | このエラー型の用途です。ない場合は null です。 |
.extends | string | このエラー型が継承する型です。ない場合は null です。 |
.fields | list | エラーのフィールド(独自のものと継承したもの)を返します: name、type、optional、description。 |
.name | string | エラー型の名前です。 |
.status | number | この型のエラーが持つ HTTP ステータスです(404 など)。ない場合は null です。 |
any のメソッド
->convert(from?: 'json'|yaml|'csv'|'markdown'|'latex', to?: 'json'|yaml|'csv'|html|'markdown'|'latex', header?: bool, as?: type, headers?: list, indented?: bool)->from(type: 'json'|yaml|'csv'|'markdown'|'latex', header?: bool, as?: type)->is_a(type: word)->is_null()->or(fallback)->to(type: 'json'|yaml|'csv'|html|'markdown'|'latex', headers?: list, indented?: bool)->to_string()->type()