Method: Paperclip::AttachmentAdapter#initialize

Defined in:
lib/paperclip/io_adapters/attachment_adapter.rb

#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, options = {})
  super
  @target, @style = case target
                    when Paperclip::Attachment
                      [target, :original]
                    when Paperclip::Style
                      [target.attachment, target.name]
                    end

  cache_current_values
end