Class: Sprockets::Processor

### Home Classes Methods

### In Files

- lib/sprockets/processor.rb

### Parent

Tilt::Template

### Methods

- ::name
- ::processor
- ::to_s
- #evaluate
- #prepare

### Class/Module Index

Quicksearch

- Sprockets
- Sprockets::ArgumentError
- Sprockets::Asset
- Sprockets::AssetAttributes
- Sprockets::Base
- Sprockets::BundledAsset
- Sprockets::Cache
- Sprockets::Cache::FileStore
- Sprockets::Caching
- Sprockets::CharsetNormalizer
- Sprockets::CircularDependencyError
- Sprockets::ContentTypeMismatch
- Sprockets::Context
- Sprockets::DirectiveProcessor
- Sprockets::EcoTemplate
- Sprockets::EjsTemplate
- Sprockets::EncodingError
- Sprockets::EngineError
- Sprockets::Engines
- Sprockets::Environment
- Sprockets::Error
- Sprockets::FileNotFound
- Sprockets::FileOutsidePaths
- Sprockets::Index
- Sprockets::JstProcessor
- Sprockets::Manifest
- Sprockets::Mime
- Sprockets::ProcessedAsset
- Sprockets::ProcessedAsset::DependencyFile
- Sprockets::Processing
- Sprockets::Processor
- Sprockets::SafetyColons
- Sprockets::Server
- Sprockets::StaticAsset
- Sprockets::Trail
- Sprockets::UnserializeError
- Sprockets::Utils
- Rake
- Rake::SprocketsTask

No matching classes.

# Sprockets::Processor

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

    register_preprocessor :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

[Validate]

Generated with the Darkfish Rdoc Generator 2.