Class: Imap::Backup::FileMode

Inherits:
Object
  • Object
show all
Defined in:
lib/imap/backup/file_mode.rb

Instance Method Summary collapse

Constructor Details

#initialize(filename:) ⇒ FileMode

Returns a new instance of FileMode.



5
6
7
# File 'lib/imap/backup/file_mode.rb', line 5

def initialize(filename:)
  @filename = filename
end

Instance Method Details

#modeObject



9
10
11
12
13
14
# File 'lib/imap/backup/file_mode.rb', line 9

def mode
  return nil if !File.exist?(filename)

  stat = File.stat(filename)
  stat.mode & 0o777
end