protected function _getTransformer(array $attachment, array $options) {
        $class = isset($options['method']) ? $options['method'] : $options['class'];

        switch ($class) {
            case self::CROP:
                return new CropTransformer($options);
            break;
            case self::FLIP:
                return new FlipTransformer($options);
            break;
            case self::RESIZE:
                return new ResizeTransformer($options);
            break;
            case self::SCALE:
                return new ScaleTransformer($options);
            break;
            case self::ROTATE:
                return new RotateTransformer($options);
            break;
            case self::EXIF:
                return new ExifTransformer($options);
            break;
            case self::FIT:
                return new FitTransformer($options);
            break;
            default:
                if (isset($attachment['transformers'][$class])) {
                    return new $attachment['transformers'][$class]($options);
                }
            break;
        }

        throw new InvalidArgumentException(sprintf('Invalid transform class %s', $class));
    }