Class: UnimatrixCLI::Alchemist::RenditionProfile::AssignCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/unimatrix_cli/alchemist/rendition_profile/assign_command.rb

Instance Method Summary collapse

Methods inherited from Command

available_commands, descendants, #initialize, #read_file, #validate, #validate_collection, #write

Methods included from UnimatrixParser

included

Constructor Details

This class inherits a constructor from UnimatrixCLI::Command

Instance Method Details

#executeObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/unimatrix_cli/alchemist/rendition_profile/assign_command.rb', line 12

def execute
  video_encoder = assign_rendition_profiles_to_encoder

  if validate( video_encoder, 'Alchemist::VideoEncoder' )

    rendition_profile = video_encoder.rendition_profiles.first

    if validate( rendition_profile, 'Alchemist::RenditionProfile' )
      write( 
        message: "Success assigning rendition_profile " +
          "#{ rendition_profile.uuid } to " +
          "video_encoder #{ video_encoder.uuid }" 
      )
    else
      write( 
        message: "Error assigning rendition_profile " +
          "to video_encoder: #{ video_encoder.inspect }", 
        error: true 
      )
    end
  else
    write( 
      message: "Error assigning rendition_profile " +
        "to video_encoder: #{ video_encoder.inspect }", 
      error: true 
    )
  end
end