Class: PopCap::Converter

Inherits:
FFmpeg
  • Object
show all
Defined in:
lib/pop_cap/ffmpeg/converter.rb

Overview

Public: This class converts an audio file to the specified output format.

Instance Attribute Summary

Attributes inherited from FFmpeg

#commander, #filepath, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FFmpeg

#error_message, #execute, #initialize

Constructor Details

This class inherits a constructor from PopCap::FFmpeg

Class Method Details

.convert(filepath, options = {}) ⇒ Object

Public: A convenience class method which wraps the instance constructor.



19
20
21
# File 'lib/pop_cap/ffmpeg/converter.rb', line 19

def self.convert(filepath, options={})
  new(filepath, options).convert
end

Instance Method Details

#convertObject

Public: This method will execute the conversion.



10
11
12
13
14
# File 'lib/pop_cap/ffmpeg/converter.rb', line 10

def convert
  unless execute.success?
    raise(FFmpegError, error_message('converting'))
  end
end