Sha256: ceefa4b783cde7e0f2715144c9b0b0274bbc182ae58ab83312504b6c7f8ba723

Contents?: true

Size: 1.22 KB

Versions: 20

Compression:

Stored size: 1.22 KB

Contents

module Ddr
  module Derivatives
    extend ActiveSupport::Autoload

    autoload :Generator
    autoload :PngGenerator
    autoload :PtifGenerator
    autoload :UpdateDerivatives

    Derivative = Struct.new(:name, :datastream, :generator, :options)

    # Derivatives to generate.  Array of DERIVATIVE names
    mattr_accessor :update_derivatives

    # Eventually, we should inject the generator (probably) and the options (certainly) for each derivative
    # (e.g., from configuration)
    DERIVATIVES = {
                    multires_image:
                        Derivative.new( :multires_image,
                                        Ddr::Datastreams::MULTIRES_IMAGE,
                                        Ddr::Derivatives::PtifGenerator,
                                        "jpeg:90,tile:256x256,pyramid"),
                    thumbnail:
                        Derivative.new( :thumbnail,
                                        Ddr::Datastreams::THUMBNAIL,
                                        Ddr::Derivatives::PngGenerator,
                                        "-resize '100x100>'")
                  }

    # Yields an object with module configuration accessors
    def self.configure
      yield self
    end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ddr-models-2.11.0 lib/ddr/derivatives.rb
ddr-models-2.10.2 lib/ddr/derivatives.rb
ddr-models-2.10.1 lib/ddr/derivatives.rb
ddr-models-2.10.0 lib/ddr/derivatives.rb
ddr-models-2.10.0.rc2 lib/ddr/derivatives.rb
ddr-models-2.10.0.rc1 lib/ddr/derivatives.rb
ddr-models-2.9.2 lib/ddr/derivatives.rb
ddr-models-2.9.1 lib/ddr/derivatives.rb
ddr-models-2.9.0 lib/ddr/derivatives.rb
ddr-models-2.9.0.rc1 lib/ddr/derivatives.rb
ddr-models-2.8.0 lib/ddr/derivatives.rb
ddr-models-2.8.0.rc1 lib/ddr/derivatives.rb
ddr-models-2.7.6 lib/ddr/derivatives.rb
ddr-models-2.7.5 lib/ddr/derivatives.rb
ddr-models-2.7.4 lib/ddr/derivatives.rb
ddr-models-2.7.3 lib/ddr/derivatives.rb
ddr-models-2.7.2 lib/ddr/derivatives.rb
ddr-models-2.7.1 lib/ddr/derivatives.rb
ddr-models-2.7.0 lib/ddr/derivatives.rb
ddr-models-2.7.0.rc1 lib/ddr/derivatives.rb