Class: Paperdragon::Paperclip::Uid
- Inherits:
-
Object
- Object
- Paperdragon::Paperclip::Uid
- Defined in:
- lib/paperdragon/paperclip.rb
Overview
Compute a UID to be compatible with paperclip. This class is meant to be subclassed so you can write your specific file path. Immutable
Defined Under Namespace
Classes: HashKey, IdPartition
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options) ⇒ Uid
constructor
“/system/:class/:attachment/:id_partition/:style/:filename”.
Constructor Details
#initialize(options) ⇒ Uid
“/system/:class/:attachment/:id_partition/:style/:filename”
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/paperdragon/paperclip.rb', line 13 def initialize() @class_name = [:class_name] @attachment = [:attachment] @id = [:id] @style = [:style] @updated_at = [:updated_at] @file_name = [:file_name] @hash_secret = [:hash_secret] @fingerprint = [:fingerprint] # not used in default. end |
Class Method Details
.from(options) ⇒ Object
8 9 10 |
# File 'lib/paperdragon/paperclip.rb', line 8 def self.from() new().call end |
Instance Method Details
#call ⇒ Object
24 25 26 27 28 |
# File 'lib/paperdragon/paperclip.rb', line 24 def call # default: # system/:class/:attachment/:id_partition/:style/:filename "#{root}/#{class_name}/#{}/#{id_partition}/#{hash}/#{style}/#{file_name}" end |