Module: MultiEncoder::Storage::FileSystem
- Defined in:
- lib/multi_encoder/storage/filesystem.rb
Instance Method Summary collapse
Instance Method Details
#directory ⇒ Object
13 14 15 |
# File 'lib/multi_encoder/storage/filesystem.rb', line 13 def directory root.join 'public', 'system', type, *fingerprint end |
#exists? ⇒ Boolean
21 22 23 |
# File 'lib/multi_encoder/storage/filesystem.rb', line 21 def exists? file_path.exist? end |
#file_path ⇒ Object
17 18 19 |
# File 'lib/multi_encoder/storage/filesystem.rb', line 17 def file_path Pathname.new "#{directory.join(@contents)}.#{MultiEncoder::BarcodeImage::OUTPUT_FORMAT}" end |
#root ⇒ Object
9 10 11 |
# File 'lib/multi_encoder/storage/filesystem.rb', line 9 def root defined?(Rails) ? Rails.root : Pathname.new('/tmp') end |
#url ⇒ Object
5 6 7 |
# File 'lib/multi_encoder/storage/filesystem.rb', line 5 def url file_path.to_s.gsub Rails.root.join('public').to_s, '' end |