### Home Classes Methods

### In Files

- lib/prawn/image_handler.rb

### Parent

Object

### Methods

- ::new
- #find
- #register
- #register!
- #unregister

### Class/Module Index

Quicksearch

- Prawn
- Prawn::Configurable
- Prawn::Document
- Prawn::Document::BoundingBox
- Prawn::Document::ColumnBox
- Prawn::Document::GraphicsState
- Prawn::Document::Grid
- Prawn::Document::GridBox
- Prawn::Document::Internals
- Prawn::Document::Security
- Prawn::Document::Snapshot
- Prawn::Encoding
- Prawn::Errors
- Prawn::Font
- Prawn::Font::AFM
- Prawn::Font::DFont
- Prawn::Font::TTF
- Prawn::FontMetricCache
- Prawn::Graphics
- Prawn::Graphics::CapStyle
- Prawn::Graphics::Color
- Prawn::Graphics::Dash
- Prawn::Graphics::JoinStyle
- Prawn::Graphics::Patterns
- Prawn::Graphics::Transformation
- Prawn::Graphics::Transparency
- Prawn::ImageHandler
- Prawn::Images
- Prawn::Images::Image
- Prawn::Images::JPG
- Prawn::Images::PNG
- Prawn::Measurements
- Prawn::SoftMask
- Prawn::Stamp
- Prawn::SynchronizedCache
- Prawn::Table
- Prawn::Table::Cell
- Prawn::Table::Cell::Image
- Prawn::Table::Cell::InTable
- Prawn::Table::Cell::SpanDummy
- Prawn::Table::Cell::Subtable
- Prawn::Table::Cell::Text
- Prawn::Table::Cells
- Prawn::Table::ColumnWidthCalculator
- Prawn::Text
- Prawn::Text::Box
- Prawn::Text::Formatted
- Prawn::Text::Formatted::Box
- Prawn::Text::Formatted::Fragment
- Prawn::Text::Formatted::Parser
- Prawn::ThreadLocalCache
- PDF
- PDF::Core
- PDF::Core::Reference
- PDF::Core::Stream
- Arcfour
- Numeric

No matching classes.

# Prawn::ImageHandler

### Public Class Methods

new() click to toggle source

    # File lib/prawn/image_handler.rb, line 9
    def initialize
      @handlers = []
    end

### Public Instance Methods

find(image_blob) click to toggle source

    # File lib/prawn/image_handler.rb, line 27
    def find(image_blob)
      handler = @handlers.find{ |h| h.can_render? image_blob }

      return handler if handler

      raise Prawn::Errors::UnsupportedImageType,
            "image file is an unrecognised format"
    end

register(handler) click to toggle source

    # File lib/prawn/image_handler.rb, line 13
    def register(handler)
      @handlers.delete(handler)
      @handlers.push handler
    end

register!(handler) click to toggle source

    # File lib/prawn/image_handler.rb, line 18
    def register!(handler)
      @handlers.delete(handler)
      @handlers.unshift handler
    end

unregister(handler) click to toggle source

    # File lib/prawn/image_handler.rb, line 23
    def unregister(handler)
      @handlers.reject!{ |h| h == handler }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.