Class: Paperclip::AttachmentAdapter
- Inherits:
-
AbstractAdapter
- Object
- AbstractAdapter
- Paperclip::AttachmentAdapter
- Defined in:
- lib/paperclip/io_adapters/attachment_adapter.rb
Constant Summary
Constants inherited from AbstractAdapter
Paperclip::AbstractAdapter::OS_RESTRICTED_CHARACTERS
Instance Attribute Summary
Attributes inherited from AbstractAdapter
#content_type, #original_filename, #size, #tempfile
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(target, options = {}) ⇒ AttachmentAdapter
constructor
A new instance of AttachmentAdapter.
Methods inherited from AbstractAdapter
#assignment?, #fingerprint, #inspect, #nil?, #read
Constructor Details
#initialize(target, options = {}) ⇒ AttachmentAdapter
Returns a new instance of AttachmentAdapter.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/paperclip/io_adapters/attachment_adapter.rb', line 9 def initialize(target, = {}) super @target, @style = case target when Paperclip::Attachment [target, :original] when Paperclip::Style [target., target.name] end cache_current_values end |
Class Method Details
.register ⇒ Object
3 4 5 6 7 |
# File 'lib/paperclip/io_adapters/attachment_adapter.rb', line 3 def self.register Paperclip.io_adapters.register self do |target| Paperclip::Attachment === target || Paperclip::Style === target end end |