Class: UnimatrixCLI::Alchemist::Rendition::ListCommand
- Defined in:
- lib/unimatrix_cli/alchemist/rendition/list_command.rb
Instance Method Summary collapse
Methods inherited from Command
available_commands, descendants, #initialize, #read_file, #validate, #validate_collection, #write
Methods included from UnimatrixParser
Constructor Details
This class inherits a constructor from UnimatrixCLI::Command
Instance Method Details
#execute ⇒ Object
11 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 40 41 |
# File 'lib/unimatrix_cli/alchemist/rendition/list_command.rb', line 11 def execute activity_proxies = find_renditions_and_activity_proxies if validate_collection( activity_proxies, 'Alchemist::ActivityProxy' ) completed_proxies = activity_proxies.reject { | proxy | proxy.renditions.empty? } renditions = completed_proxies.map( &:renditions ).flatten if validate_collection( renditions, 'Alchemist::Rendition' ) renditions.each do | rendition | write( message: parse_rendition( rendition ) ) end activity_proxies.each do | activity_proxy | = parse_activity_proxy( activity_proxy ) write( message: ) if end else write( message: "No completed, pending, or progressing " + "renditions found: #{ renditions.inspect }", error: true ) end else write( message: "Error retrieving activity_proxies for " + "the given video: #{ activity_proxies.inspect }", error: true ) end end |