class Sprockets::Processor - sprockets-2.11.3 Documentation

# class Sprockets::Processor

`Processor` creates an anonymous processor class from a block.

    register_preprocessor 'text/css', :my_processor do |context, data|
      # ...
    end

### Public Class Methods

name() click to toggle source

    # File lib/sprockets/processor.rb, line 16
    def self.name
      "Sprockets::Processor (#{@name})"
    end

processor() click to toggle source

`processor` is a lambda or block

    # File lib/sprockets/processor.rb, line 12
    def self.processor
      @processor
    end

to_s() click to toggle source

    # File lib/sprockets/processor.rb, line 20
    def self.to_s
      name
    end

### Public Instance Methods

evaluate(context, locals) click to toggle source

Call processor block with `context` and `data`.

    # File lib/sprockets/processor.rb, line 28
    def evaluate(context, locals)
      self.class.processor.call(context, data)
    end

prepare() click to toggle source

    # File lib/sprockets/processor.rb, line 24
    def prepare
    end