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.
98 99 100 |
# File 'lib/ftpd/list_format/ls.rb', line 98 def initialize(mode) @mode = mode end |
Instance Method Details
#letters ⇒ Object
Return the mode bits as ls style letters. For example, “-rw-r–r–”
105 106 107 108 109 110 111 |
# File 'lib/ftpd/list_format/ls.rb', line 105 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 |