Class: Av::Cli
- Inherits:
-
Object
- Object
- Av::Cli
- Defined in:
- lib/av/cli.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
Instance Method Summary collapse
-
#initialize(options) ⇒ Cli
constructor
A new instance of Cli.
Constructor Details
#initialize(options) ⇒ Cli
Returns a new instance of Cli.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/av/cli.rb', line 5 def initialize() found = [] found << 'avconv' if self.detect_command('avprobe') found << 'ffmpeg' if self.detect_command('ffmpeg') if found.empty? raise Av::UnableToDetect, "Unable to detect any supported library" else @command = Object.const_get('Av').const_get('Commands').const_get(found.first.capitalize).new() end ::Av.log("Found #{found.inspect}, using: #{found.first.capitalize}") end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object (protected)
18 19 20 |
# File 'lib/av/cli.rb', line 18 def method_missing name, *args, &block @command.send(name, *args, &block) end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
3 4 5 |
# File 'lib/av/cli.rb', line 3 def command @command end |