Class: Thunderbird::SubdirectoryPlaceholder

Inherits:
Object
  • Object
show all
Defined in:
lib/thunderbird/subdirectory_placeholder.rb

Overview

Each subdirectory is “accompanied” by a blank file of the same name (without the ‘.sbd’ extension)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:) ⇒ SubdirectoryPlaceholder

Returns a new instance of SubdirectoryPlaceholder.



9
10
11
# File 'lib/thunderbird/subdirectory_placeholder.rb', line 9

def initialize(path:)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/thunderbird/subdirectory_placeholder.rb', line 7

def path
  @path
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/thunderbird/subdirectory_placeholder.rb', line 13

def exists?
  File.exist?(path)
end

#regular?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/thunderbird/subdirectory_placeholder.rb', line 17

def regular?
  File.file?(path)
end

#touchObject



21
22
23
# File 'lib/thunderbird/subdirectory_placeholder.rb', line 21

def touch
  FileUtils.touch path
end