Module: Balloon::Cache

Extended by:
ActiveSupport::Concern
Defined in:
lib/balloon/cache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cache_cidObject (readonly)

Returns the value of attribute cache_cid.



5
6
7
# File 'lib/balloon/cache.rb', line 5

def cache_cid
  @cache_cid
end

Instance Method Details

#cache_directoryObject



20
21
22
# File 'lib/balloon/cache.rb', line 20

def cache_directory
  File.join cache_dir, "images", cache_cid
end

#cache_pathObject



16
17
18
# File 'lib/balloon/cache.rb', line 16

def cache_path
  File.expand_path cache_directory, root
end

#down_cache_directoryObject



33
34
35
# File 'lib/balloon/cache.rb', line 33

def down_cache_directory
  File.join cache_dir, "net"
end

#down_cache_pathObject



29
30
31
# File 'lib/balloon/cache.rb', line 29

def down_cache_path
  File.expand_path down_cache_directory, root
end

#generate_cache_directoryObject

generate cache directory in system

Returns:



10
11
12
13
14
# File 'lib/balloon/cache.rb', line 10

def generate_cache_directory
  @cache_cid = generate_cid
  FileUtils.mkdir_p(cache_path)
  FileUtils.chmod dir_permissions.to_i, cache_path
end

#generate_down_cache_directoryObject



24
25
26
27
# File 'lib/balloon/cache.rb', line 24

def generate_down_cache_directory
  FileUtils.mkdir_p(down_cache_path)
  FileUtils.chmod dir_permissions.to_i, down_cache_path
end