Class: Media::Command::Probe

Inherits:
Object
  • Object
show all
Defined in:
lib/media/command/probe.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Probe

Returns a new instance of Probe.



7
8
9
10
11
12
13
# File 'lib/media/command/probe.rb', line 7

def initialize(args)
  @options = Array args.fetch(:options, [])
  @input   = args.fetch(:input)
  
  @cmd      = args.fetch(:cmd, 'ffprobe')
  @subshell = args.fetch(:subshell, Subshell)
end

Instance Method Details

#callObject



15
16
17
# File 'lib/media/command/probe.rb', line 15

def call
  @subshell.new(cmd: to_s).call
end

#to_sObject



19
20
21
# File 'lib/media/command/probe.rb', line 19

def to_s
  [@cmd, @options, @input].reject(&:empty?).join(' ')
end