Class: Datasets::CachePath
- Inherits:
-
Object
- Object
- Datasets::CachePath
- Defined in:
- lib/datasets/cache-path.rb
Instance Method Summary collapse
- #base_dir ⇒ Object
-
#initialize(id) ⇒ CachePath
constructor
A new instance of CachePath.
- #remove ⇒ Object
Constructor Details
#initialize(id) ⇒ CachePath
Returns a new instance of CachePath.
3 4 5 |
# File 'lib/datasets/cache-path.rb', line 3 def initialize(id) @id = id end |
Instance Method Details
#base_dir ⇒ Object
7 8 9 |
# File 'lib/datasets/cache-path.rb', line 7 def base_dir Pathname(system_cache_dir). + 'red-datasets' + @id end |
#remove ⇒ Object
11 12 13 |
# File 'lib/datasets/cache-path.rb', line 11 def remove FileUtils.rmtree(base_dir.to_s, secure: true) if base_dir.exist? end |