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()