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.
9 10 11 |
# File 'lib/thunderbird/subdirectory_placeholder.rb', line 9 def initialize(path:) @path = path end |
Instance Attribute Details
#path ⇒ Object (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
13 14 15 |
# File 'lib/thunderbird/subdirectory_placeholder.rb', line 13 def exists? File.exist?(path) end |
#regular? ⇒ Boolean
17 18 19 |
# File 'lib/thunderbird/subdirectory_placeholder.rb', line 17 def regular? File.file?(path) end |
#touch ⇒ Object
21 22 23 |
# File 'lib/thunderbird/subdirectory_placeholder.rb', line 21 def touch FileUtils.touch path end |