Class | Paperclip::Processor
In: | vendor/plugins/paperclip/lib/paperclip/processor.rb
Parent: | Object

Paperclip processors allow you to modify attached files when they are attached in any way you are able. Paperclip itself uses command-line programs for its included Thumbnail processor, but custom processors are not required to follow suit.

Processors are required to be defined inside the Paperclip module and are also required to be a subclass of Paperclip::Processor. There are only two methods you must implement to properly be a subclass: initialize and make. Initialize‘s arguments are the file that will be operated on (which is an instance of File), and a hash of options that were defined in has_attached_file‘s style hash.

All make needs to do is return an instance of File (Tempfile is acceptable) which contains the results of the processing.

See Paperclip.run for more information about using command-line utilities from within Processors.

### Methods

make make new

### Attributes

attachment | [RW] |
file | [RW] |
options | [RW] |

### Public Class methods

make(file, options = {})

[Source]

        # File vendor/plugins/paperclip/lib/paperclip/processor.rb, line 31
    31:     def self.make file, options = {}, attachment = nil
    32:       new(file, options, attachment).make
    33:     end

new(file, options = {})

[Source]

        # File vendor/plugins/paperclip/lib/paperclip/processor.rb, line 22
    22:     def initialize file, options = {}, attachment = nil
    23:       @file = file
    24:       @options = options
    25:       @attachment = attachment
    26:     end

### Public Instance methods

make()

[Source]

        # File vendor/plugins/paperclip/lib/paperclip/processor.rb, line 28
    28:     def make
    29:     end

[Validate]