Class: Ftpd::ListFormat::Ls::FileMode
- Inherits:
-
Object
- Object
- Ftpd::ListFormat::Ls::FileMode
- Defined in:
- lib/ftpd/list_format/ls.rb
Overview
Map file mode bits into ls style file mode letters
Instance Method Summary collapse
-
#initialize(mode) ⇒ FileMode
constructor
A new instance of FileMode.
-
#letters ⇒ Object
Return the mode bits as ls style letters.
Constructor Details
#initialize(mode) ⇒ FileMode
Returns a new instance of FileMode.
100 101 102 |
# File 'lib/ftpd/list_format/ls.rb', line 100 def initialize(mode) @mode = mode end |
Instance Method Details
#letters ⇒ Object
Return the mode bits as ls style letters. For example, “-rw-r–r–”
107 108 109 110 111 112 113 |
# File 'lib/ftpd/list_format/ls.rb', line 107 def letters [ triad(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, SET_UID, 'Ss'), triad(GROUP_READ, GROUP_WRITE, GROUP_EXECUTE, SET_GID, 'Ss'), triad(OTHER_READ, OTHER_WRITE, OTHER_EXECUTE, STICKY, 'Tt'), ].join end |