file_path のフィールドとメソッド
フィールドは、値についての単純な事実で、ドットを使い角括弧なしで読み取ります: $value.name。メソッドは引数を取るか処理を行い、-> で呼び出します: $value->name(arguments)。または、値をパイプで渡して呼び出します: $value |> name(arguments)。
フィールド
| フィールド | 型 | 説明 |
|---|---|---|
.extension | string | 最後のドットの後ろにある拡張子(ドットは含まない)です。./reports/summary.pdf では pdf になります。拡張子がない場合は '' を返します。 |
.folder | file_path | それが含まれるフォルダのパスです。./reports/summary.pdf では ./reports、./ 自体では null を返します。 |
.name | string | 最後の名前(拡張子を含む)です。./reports/summary.pdf では summary.pdf になります。 |
.segments | list | 記述どおりの名前を順に並べたリストです。./reports/summary.pdf では ['.', 'reports', 'summary.pdf'] になります。 |
.stem | string | 拡張子を除いた最後の名前です。./reports/summary.pdf では summary、summary.final.pdf では summary.final になります。 |
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()
string のメソッド
->contains(text, ignore_case?: bool)->count()->ends_with(text, ignore_case?: bool)->escape()->index_of(text, ignore_case?: bool, last?: bool)->lower()->markdown_escape()->matches(pattern: regex)->pad(width: number, char?, start?: bool)->replace(old, new, ignore_case?: bool)->slice(start: number, end?: number)->split(separator?)->starts_with(text, ignore_case?: bool)->truncate(length: number, suffix?)->upper()->url_encode()