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.



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

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/thunderbird/subdirectory_placeholder.rb', line 4

def path
  @path
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


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

def exists?
  File.exist?(path)
end

#regular?Boolean

Returns:

  • (Boolean)


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

def regular?
  File.file?(path)
end

#touchObject



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

def touch
  FileUtils.touch path
end