Class: Tools::Formats::Format

Inherits:
Object
  • Object
show all
Includes:
Support::Manifest
Defined in:
lib/tools/formats/format.rb

Direct Known Subclasses

F320, FV0, FV2

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



8
9
10
# File 'lib/tools/formats/format.rb', line 8

def files
  @files
end

Class Method Details

.create_from_configuration(formats) ⇒ Array<Format>

Generate Format objects for all objects in the ‘formats` hash

Parameters:

  • formats (Hash)

    K: format name, V: path to manifest file

Returns:

  • (Array<Format>)

    Returns an array of Format objects



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/tools/formats/format.rb', line 13

def self.create_from_configuration(formats)
  initialized_formats = []

  formats.each do |format_str, manifest_path|
    # Format prefixed with an F
    format_name = format_class_name(format_str)

    # Constantized name, namespaced to the current namespace
    format_class = namespaced_class(format_name)

    # Initialize a new Format object with the corresponding manifest
    format_object = format_class.new(manifest_path)

    # Add it to the array to be returned
    initialized_formats << format_object
  end

  initialized_formats
end

Instance Method Details

#keyObject



37
38
39
# File 'lib/tools/formats/format.rb', line 37

def key
  require_subclass
end

#transcode_commandObject



33
34
35
# File 'lib/tools/formats/format.rb', line 33

def transcode_command
  require_subclass
end