Sha256: f6cc0ebabf7322a39272d1a58150094eb9a22dc5a40edf72c9cf91e4453a3c2c

Contents?: true

Size: 824 Bytes

Versions: 27

Compression:

Stored size: 824 Bytes

Contents

module Ddr
  module Derivatives
    # @abstract
    class Generator

      attr_reader :source, :output, :options

      def initialize source, output, options=nil
        raise ArgumentError, "Source must be a File or path to a file" unless Ddr::Utils.file_or_path?(source)
        raise ArgumentError, "Output must be a File or path to a file" unless Ddr::Utils.file_or_path?(output)
        @source = source
        @output = output
        @options = options
      end

      # The mime type of the output generated.
      # Implemented in each subclass.
      def self.output_mime_type
        raise NotImplementedError
      end

      # The actions required to generate the output from the source.
      # Implemented in each subclass.
      def generate
        raise NotImplementedError
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

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