Module: Balloon::Cache
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/balloon/cache.rb
Instance Attribute Summary collapse
-
#cache_cid ⇒ Object
readonly
Returns the value of attribute cache_cid.
Instance Method Summary collapse
- #cache_directory ⇒ Object
- #cache_path ⇒ Object
- #down_cache_directory ⇒ Object
- #down_cache_path ⇒ Object
-
#generate_cache_directory ⇒ Object
generate cache directory in system.
- #generate_down_cache_directory ⇒ Object
Instance Attribute Details
#cache_cid ⇒ Object (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_directory ⇒ Object
20 21 22 |
# File 'lib/balloon/cache.rb', line 20 def cache_directory File.join cache_dir, "images", cache_cid end |
#cache_path ⇒ Object
16 17 18 |
# File 'lib/balloon/cache.rb', line 16 def cache_path File. cache_directory, root end |
#down_cache_directory ⇒ Object
33 34 35 |
# File 'lib/balloon/cache.rb', line 33 def down_cache_directory File.join cache_dir, "net" end |
#down_cache_path ⇒ Object
29 30 31 |
# File 'lib/balloon/cache.rb', line 29 def down_cache_path File. down_cache_directory, root end |
#generate_cache_directory ⇒ Object
generate cache directory in system
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 .to_i, cache_path end |
#generate_down_cache_directory ⇒ Object
24 25 26 27 |
# File 'lib/balloon/cache.rb', line 24 def generate_down_cache_directory FileUtils.mkdir_p(down_cache_path) FileUtils.chmod .to_i, down_cache_path end |