Class: Thunderbird::SubdirectoryPlaceholder
- Inherits:
-
Object
- Object
- Thunderbird::SubdirectoryPlaceholder
- 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
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(path) ⇒ SubdirectoryPlaceholder
constructor
A new instance of SubdirectoryPlaceholder.
- #regular? ⇒ Boolean
- #touch ⇒ Object
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
#path ⇒ Object (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
10 11 12 |
# File 'lib/thunderbird/subdirectory_placeholder.rb', line 10 def exists? File.exist?(path) end |
#regular? ⇒ Boolean
14 15 16 |
# File 'lib/thunderbird/subdirectory_placeholder.rb', line 14 def regular? File.file?(path) end |
#touch ⇒ Object
18 19 20 |
# File 'lib/thunderbird/subdirectory_placeholder.rb', line 18 def touch FileUtils.touch path end |