Class: Datasets::CachePath

Inherits:
Object
  • Object
show all
Defined in:
lib/datasets/cache-path.rb

Instance Method Summary collapse

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_dirObject



7
8
9
# File 'lib/datasets/cache-path.rb', line 7

def base_dir
  Pathname(system_cache_dir).expand_path + 'red-datasets' + @id
end

#removeObject



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