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