Class: Ftpd::ListFormat::Ls::FileType
- Inherits:
-
Object
- Object
- Ftpd::ListFormat::Ls::FileType
- Defined in:
- lib/ftpd/list_format/ls.rb
Overview
Map file type strings to ls file type letters
Class Method Summary collapse
-
.letter(ftype) ⇒ String
Map a file type string to a file type letter.
Class Method Details
.letter(ftype) ⇒ String
Map a file type string to a file type letter.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/ftpd/list_format/ls.rb', line 68 def self.letter(ftype) case ftype when 'file' '-' when 'directory' 'd' when 'characterSpecial' 'c' when 'blockSpecial' 'b' when 'fifo' 'p' when 'link' 'l' when 'socket' 's' else # 'unknown', etc. '?' end end |