class Thingfish::Processor::Image::MagickOperations

A struct that can represent the support in the installed ImageMagick for common operations. See Magick.formats for details.

Attributes

blob[R]

Supported features

ext[R]

Supported features

multi[R]

Supported features

read[R]

Supported features

write[R]

Supported features

Public Class Methods

new( ext, support_string ) click to toggle source

Create a new MagickOperations for the given ext, reading the supported features of the format from support_string.

# File lib/thingfish/processor/image.rb, line 212
def initialize( ext, support_string )
        @ext = ext
        @blob, @read, @write, @multi = support_string.split('')
end

Public Instance Methods

can_read?() click to toggle source

Returns true if the operation string indicates that ImageMagick has native blob support for the associated type

# File lib/thingfish/processor/image.rb, line 242
def can_read?
        return (@read == 'r')
end
can_write?() click to toggle source

Returns true if the operation string indicates that ImageMagick has native blob support for the associated type

# File lib/thingfish/processor/image.rb, line 249
def can_write?
        return (@write == 'w')
end
has_native_blob?() click to toggle source

Returns true if the operation string indicates that ImageMagick has native blob support for the associated type

# File lib/thingfish/processor/image.rb, line 235
def has_native_blob?
        return (@blob == '*')
end
supports_multi?() click to toggle source

Returns true if the operation string indicates that ImageMagick has native blob support for the associated type

# File lib/thingfish/processor/image.rb, line 256
def supports_multi?
        return (@multi == '+')
end
to_s() click to toggle source

Return a human-readable description of the operations spec

# File lib/thingfish/processor/image.rb, line 223
def to_s
        return [
                self.has_native_blob?       ? "Blob" : nil,
                self.can_read?                      ? "Readable" : nil,
                self.can_write?                     ? "Writable" : nil,
                self.supports_multi?        ? "Multi" : nil,
        ].compact.join(',')
end