Module: Grim

Extended by:
Grim
Included in:
Grim
Defined in:
lib/grim.rb,
lib/grim/pdf.rb,
lib/grim/page.rb,
lib/grim/version.rb,
lib/grim/null_logger.rb,
lib/grim/multi_processor.rb,
lib/grim/image_magick_processor.rb

Defined Under Namespace

Classes: Exception, ImageMagickProcessor, MultiProcessor, NullLogger, Page, PageNotFound, PathMissing, Pdf, PdfNotFound, UnprocessablePage

Constant Summary collapse

WIDTH =

Default resize output width, any positive integer

1024
QUALITY =

Default image quality, 1 to 100

90
DENSITY =

Default density, any positive integer

300
COLORSPACE =

Default colorspace

"RGB"
VERSION =
"1.3.3"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#processorObject

Returns the value of attribute processor.



6
7
8
# File 'lib/grim.rb', line 6

def processor
  @processor
end

Class Method Details

.loggerObject

Logger to use internally. Defaults to Grim::NullLogger.

Returns a Logger compatible logger.



64
65
66
# File 'lib/grim.rb', line 64

def self.logger
  @logger ||= Grim::NullLogger.new
end

.logger=(logger) ⇒ Object

Set a Logger compatible logger for Grim.

logger - Object with same interface as Logger.new



57
58
59
# File 'lib/grim.rb', line 57

def self.logger=(logger)
  @logger = logger
end

.reap(path) ⇒ Object

Creates and returns a new instance of Grim::Pdf

path - a path string or object

For example:

pdf = Grim.reap(/path/to/pdf)

Returns an instance of Grim::Pdf



50
51
52
# File 'lib/grim.rb', line 50

def self.reap(path)
  Grim::Pdf.new(path)
end