Class: Ddr::Derivatives::Generator Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/ddr/derivatives/generators/generator.rb

Overview

This class is abstract.

Direct Known Subclasses

PngGenerator, PtifGenerator

Defined Under Namespace

Classes: GeneratorResult

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = nil) ⇒ Generator

Returns a new instance of Generator.



10
11
12
# File 'lib/ddr/derivatives/generators/generator.rb', line 10

def initialize(options=nil)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/ddr/derivatives/generators/generator.rb', line 6

def options
  @options
end

Class Method Details

.output_extensionObject

The extension to use for the output generated. Implemented in each subclass

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/ddr/derivatives/generators/generator.rb', line 22

def self.output_extension
  raise NotImplementedError
end

.output_mime_typeObject

The mime type of the output generated. Implemented in each subclass.

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/ddr/derivatives/generators/generator.rb', line 16

def self.output_mime_type
  raise NotImplementedError
end

Instance Method Details

#generate(source_path, output_path) ⇒ Object

The actions required to generate the output from the source. Implemented in each subclass.

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/ddr/derivatives/generators/generator.rb', line 28

def generate(source_path, output_path)
  raise NotImplementedError
end